{"_id":"get-view","_rev":"81989","name":"get-view","description":"Utility for getting an assemble view from a collection object.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:26:09.000Z","created":"2016-01-21T10:26:46.250Z","2.0.0":"2018-03-19T00:25:33.962Z","1.0.0":"2018-02-14T11:56:05.149Z","0.1.3":"2017-02-01T18:12:15.055Z","0.1.2":"2016-07-25T04:13:46.152Z","0.1.1":"2016-01-21T10:33:44.278Z","0.1.0":"2016-01-21T10:26:46.250Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"versions":{"2.0.0":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"2.0.0","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha"},"dependencies":{"path-ends-with":"^2.0.0"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["assemble","collection","file","find","get","gulpfriendly","match","view","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]},"lint":{"reflinks":true}},"gitHead":"8bc25a388f5b5f0631e2df2bc61b29f3c27ac294","_id":"get-view@2.0.0","_npmVersion":"5.7.1","_nodeVersion":"9.7.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"c94ff46c5a779b96c77d87cea63010f692bc1c91","size":3619,"noattachment":false,"key":"/get-view/-/get-view-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-2.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-view_2.0.0_1521419133870_0.03601102527492839"},"_hasShrinkwrap":false,"publish_time":1521419133962,"_cnpm_publish_time":1521419133962},"1.0.0":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"match-file":"^1.0.0"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3","templates":"^1.2.9"},"keywords":["assemble","collection","file","find","get","gulpfriendly","match","view","vinyl"],"verb":{"reflinks":["assemble","gulp","templates","verb","vinyl"],"layout":"default","plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]},"toc":false},"gitHead":"64648c6263abb952e9e391ab4818337d3c771169","_id":"get-view@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"59eeab687e52ec115cc61aced2ad92d9136d83d0","size":3229,"noattachment":false,"key":"/get-view/-/get-view-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-1.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-view_1.0.0_1518609364509_0.2809200627277624"},"_hasShrinkwrap":false,"publish_time":1518609365149,"_cnpm_publish_time":1518609365149},"0.1.3":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"isobject":"^3.0.0","match-file":"^0.2.1"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0","templates":"^1.1.1"},"keywords":["assemble","collection","file","find","get","gulpfriendly","match","view","vinyl"],"verb":{"reflinks":["assemble","gulp","templates","verb","vinyl"],"layout":"default","plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]},"toc":false},"gitHead":"666737bdd03bf1c9d65d53a1083e04b8348e9250","_id":"get-view@0.1.3","_shasum":"3660ac058ba13df9749cabcaa6bcb96d41aa0ea0","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"3660ac058ba13df9749cabcaa6bcb96d41aa0ea0","size":3223,"noattachment":false,"key":"/get-view/-/get-view-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-0.1.3.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-view-0.1.3.tgz_1485972733278_0.13240281003527343"},"directories":{},"publish_time":1485972735055,"_cnpm_publish_time":1485972735055,"_hasShrinkwrap":false},"0.1.2":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js","LICENSE","README.md"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"isobject":"^2.1.0","match-file":"^0.2.0"},"devDependencies":{"gulp-format-md":"^0.1.9","mocha":"^2.5.3","templates":"^0.24.2"},"keywords":["assemble","collection","file","find","get","gulpfriendly","match","view","vinyl"],"verb":{"reflinks":["assemble","gulp","templates","verb","vinyl"],"layout":"default","plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]},"toc":false},"gitHead":"659245a92723581994a8a0efbb51d71af60b5185","_id":"get-view@0.1.2","_shasum":"9d329db81b860d59c981a6971659d56111b26fe7","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"9d329db81b860d59c981a6971659d56111b26fe7","size":3155,"noattachment":false,"key":"/get-view/-/get-view-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-view-0.1.2.tgz_1469420024171_0.8539429272059351"},"directories":{},"publish_time":1469420026152,"_cnpm_publish_time":1469420026152,"_hasShrinkwrap":false},"0.1.1":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"match-file":"^0.1.0"},"devDependencies":{"gulp-format-md":"^0.1.5","mocha":"*","templates":"^0.10.7"},"keywords":["assemble","collection","file","find","gulpfriendly","match","view","vinyl"],"verb":{"reflinks":["assemble","gulp","templates","verb","vinyl"],"layout":"default","plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]}},"gitHead":"71250cc7ccc936f0f27f82fc0a7b01d9bbd35ceb","_id":"get-view@0.1.1","_shasum":"6d95a87797d405cb387566bf46b52339e2dac57a","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"6d95a87797d405cb387566bf46b52339e2dac57a","size":2756,"noattachment":false,"key":"/get-view/-/get-view-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-0.1.1.tgz"},"directories":{},"publish_time":1453372424278,"_cnpm_publish_time":1453372424278,"_hasShrinkwrap":false},"0.1.0":{"name":"get-view","description":"Utility for getting an assemble view from a collection object.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/get-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/get-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"match-file":"^0.1.0"},"devDependencies":{"gulp-format-md":"^0.1.5","mocha":"*","templates":"^0.10.7"},"keywords":[],"verb":{"reflinks":["assemble","gulp","templates","verb","vinyl"],"layout":"default","plugins":["gulp-format-md"],"related":{"list":["assemble","gulp","match-file","templates","verb","vinyl"]}},"_id":"get-view@0.1.0","_shasum":"c339e74a0fe7961e7682755896fd7a9569e1cec7","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c339e74a0fe7961e7682755896fd7a9569e1cec7","size":2720,"noattachment":false,"key":"/get-view/-/get-view-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-view/download/get-view-0.1.0.tgz"},"directories":{},"publish_time":1453372006250,"_cnpm_publish_time":1453372006250,"_hasShrinkwrap":false}},"readme":"# get-view [![NPM version](https://img.shields.io/npm/v/get-view.svg?style=flat)](https://www.npmjs.com/package/get-view) [![NPM monthly downloads](https://img.shields.io/npm/dm/get-view.svg?style=flat)](https://npmjs.org/package/get-view) [![NPM total downloads](https://img.shields.io/npm/dt/get-view.svg?style=flat)](https://npmjs.org/package/get-view) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/get-view.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/get-view)\n\n> Utility for getting an assemble view from a collection object.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save get-view\n```\n\n## Usage\n\nShould work with any collection of vinyl files.\n\n```js\nconst getView = require('get-view');\n```\n\n**[templates](https://github.com/jonschlinkert/templates) example**\n\nGiven the following setup code, all of the below examples would return a view from the `app.views.pages` collection:\n\n```js\nconst templates = require('templates');\napp = templates();\napp.create('page');\n\napp.page('foo', {content: 'this is foo'});\napp.page('bar.md', {content: 'this is bar'});\napp.page('a/b/c/baz.md', {content: 'this is baz', base: 'a'});\napp.page('test/fixtures/templates/a.tmpl');\n```\n\nGet a view by customizing the lookup key with a function:\n\n```js\nconst view = getView(app.views.pages, function(view) {\n  return view.stem === 'foo.md';\n});\n\n//=> <View \"foo\" <Buffer 74 68 69 73 20 69>>\n```\n\nGet a view by `view.path`\n\n```js\nconst view = getView(app.views.pages, 'a/b/c/baz.md');\n//=> <View \"b/c/baz.md\" <Buffer 74 68 69 73>>\n```\n\nGet a view by `view.basename`\n\n```js\nconst view = getView(app.views.pages, 'baz.md');\n//=> <View \"b/c/baz.md\" <Buffer 74 68 69 73>>\n```\n\nGet a view by `view.filename`\n\n```js\nconst view = getView(app.views.pages, 'baz');\n//=> <View \"b/c/baz.md\" <Buffer 74 68 69 73>>\n```\n\nGet a view by `view.relative`\n\n```js\nconst view = getView(app.views.pages, 'b/c/baz.md');\n//=> <View \"b/c/baz.md\" <Buffer 74 68 69 73>>\n```\n\n## Release history\n\n### v2.0\n\n**Breaking changes**\n\n* The order of arguments has been reversed, so that the collection of views is passed first, and the lookup value is second.\n* No longer matches with globs. This can be done by passing a glob matcher as the second argument.\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble \"Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit\")\n* [gulp](https://www.npmjs.com/package/gulp): The streaming build system | [homepage](http://gulpjs.com \"The streaming build system\")\n* [match-file](https://www.npmjs.com/package/match-file): Returns true when the given `name` matches any of the path properties on a vinyl… [more](https://github.com/jonschlinkert/match-file) | [homepage](https://github.com/jonschlinkert/match-file \"Returns true when the given `name` matches any of the path properties on a vinyl file.\")\n* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine… [more](https://github.com/jonschlinkert/templates) | [homepage](https://github.com/jonschlinkert/templates \"System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.\")\n* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb \"Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.\")\n* [vinyl](https://www.npmjs.com/package/vinyl): Virtual file format. | [homepage](https://github.com/gulpjs/vinyl#readme \"Virtual file format.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 18, 2018._","_attachments":{},"homepage":"https://github.com/jonschlinkert/get-view","bugs":{"url":"https://github.com/jonschlinkert/get-view/issues"},"license":"MIT"}