Since 0.1.0
getEntry
Read the item's file.
Reads the item's file, validates it, and applies the selected view.
const home = await homeItem.getEntry();
home.title;
home["featured-posts"][0].title; // resolved by the default view
home._meta.fileName; // "home.md"
Signature
item.getEntry(options?: { view?: ViewName }): Promise<Entry>;
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options.view | view name | no | "default" | A view declared in views |
Returns
Promise<Entry>: the schema output, _meta (fileName, filePath, no slug), resolved relations at the view's depth, and the awaited augment output.
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.