get-view is a utility designed to retrieve 'view' objects from collection structures, primarily within the `assemble` and `templates` ecosystems. It works with collections of Vinyl files, offering flexible lookup mechanisms including by path, basename, filename, relative path, or a custom function. The package is currently stable at version 2.0.0, but it appears to be abandoned, with no updates or activity detected for approximately 8 years (as of April 2026). It was designed for Node.js environments `>=6` and is tightly coupled with the older `assemble` and `templates` frameworks, which are also no longer actively maintained. As such, while functional, users should consider its long-term viability and potential lack of modern feature support or security updates.
npm install get-viewVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `templates`, add pages to its collection, and then use `get-view` to retrieve specific views based on various lookup criteria such as filename, relative path, or a custom filtering function.
Ensure `getView(collection, lookupValue)` is used, not `getView(lookupValue, collection)`.
If you relied on glob matching, implement it externally and pass a function as the second argument to `getView` that performs the glob matching.
Consider migrating to actively maintained alternatives for static site generation or build processes. If continued use is necessary, be aware of potential vulnerabilities and compatibility issues, and consider forking for self-maintenance.
For CommonJS, use `const getView = require('get-view');`. For ESM interop, use `import getView from 'get-view';`.Ensure the first argument is the collection object (e.g., `app.views.pages`) and the second is the lookup key or function: `getView(collection, lookupValue)`.
Verify the lookup key (path, basename, filename, relative) exactly matches a view's property. If using a custom function, ensure its logic correctly identifies the target view. If globbing, implement and pass a glob-matching function explicitly.
No dependency data recorded yet.