Since 0.1.0
getEntry
Read one node's content by slug.
On this page
Reads a single file by slug, validates it, and applies the selected view.
const entry = await docsTree.getEntry("guides/setup");
entry.title;
entry.markdown;
entry._meta.slug; // "guides/setup"
Signature
tree.getEntry(slug: Slug, options?: { view?: ViewName }): Promise<Entry>;
Parameters
Returns
Promise<Entry>: the schema output, _meta (slug, fileName, filePath), resolved relations at the view's depth, and the awaited augment output. No children and no navigation data.
Throws
- A raw
ENOENTerror from Node when the file does not exist. Unknown view "<name>". Available views: <names>.- Getter option errors, validation, relation, and augment errors. See Errors.
See also
- getTree for structure