{"_id":"vinyl-view","_rev":"9-f0eaecfe9bbd168ae9e934e10a9d3505","name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","dist-tags":{"latest":"2.0.1"},"versions":{"0.1.0":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","isobject":"^2.1.0","lazy-cache":"^2.0.1","mixin-deep":"^1.1.3","vinyl-item":"^0.1.0"},"devDependencies":{"event-stream":"^3.3.2","gulp-format-md":"^0.1.9","mocha":"^2.5.3"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"9c7cd5549be828c83150151b4b38e17b7f2e188e","_id":"vinyl-view@0.1.0","_shasum":"5954e4322667fb8e8f2711b29be17530117a5c05","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5954e4322667fb8e8f2711b29be17530117a5c05","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-0.1.0.tgz","integrity":"sha512-AuRezu8rviqcxcsT+NcEOfxbgd4NDrUycvdKbN7GzGqV/J2fbnswFVVyfmV1u820yo2ll1nXUGDWoxUkH+uGgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2W6jElKtmFRyJpEqiU0FT/Qq7l1mGBD1v+TxoBVXRLAIgPDSs9DS4+zBRV/l7NhNMb/oFxRMsvN0eB/v+9x+qKwM="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.0.tgz_1464795335143_0.9860407602973282"}},"0.1.1":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","LICENSE","README.md","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","isobject":"^2.1.0","lazy-cache":"^2.0.1","mixin-deep":"^1.1.3","vinyl-item":"^0.1.0"},"devDependencies":{"event-stream":"^3.3.4","gulp-format-md":"^0.1.9","mocha":"^2.5.3"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"dfa1a9b4192244df36590caf63135d6f2e284dfb","_id":"vinyl-view@0.1.1","_shasum":"54adb92b3cc5798e772c03cc5ba183815ed9463c","_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":"54adb92b3cc5798e772c03cc5ba183815ed9463c","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-0.1.1.tgz","integrity":"sha512-6wBYBGX8E1dAgXSslukU/zT1aMFuWDS6eaJPmHNK3DXA7mcdlqCU4q7MXxhxulDt8r4emxGjXiB8Hx0Pz/4vRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHCDaZXgIUyFF9uT8+4prwKMI4NSSkVsOBRV/aQN7X3yAiBETu/h3vjYT5UXgeqFMpq7CSI0SSKgPBG/xAlYjW3mnA=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.1.tgz_1469308316317_0.13928566430695355"}},"0.1.2":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","LICENSE","README.md","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","isobject":"^2.1.0","lazy-cache":"^2.0.1","mixin-deep":"^1.1.3","vinyl-item":"^0.1.0"},"devDependencies":{"event-stream":"^3.3.4","gulp-format-md":"^0.1.9","mocha":"^2.5.3"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"2953a53678bc5ed47a7ca3050d71601a8e772a93","_id":"vinyl-view@0.1.2","_shasum":"09ac6d7c801212bf0926bd9d4106f45e6c4fc977","_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":"09ac6d7c801212bf0926bd9d4106f45e6c4fc977","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-0.1.2.tgz","integrity":"sha512-qIc2qnXgOXZrT1Q1ViR1VMTjuylAi3Y/LSYSYfwJ6ZG7Ar5miUfioSIBu30bsHTo5dSz4ReDNSUw3lelCtc5Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0z8gTFTlLQsCE/0OyTbcbFMKwcLRKCLWV9A5K17PS5AiEA8h0L7UWiArYICRzQpu0pQp8V9ozXGQSMTXi2heYl3f4="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.2.tgz_1469308456160_0.1579292444512248"}},"1.0.0":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","isobject":"^3.0.0","lazy-cache":"^2.0.2","mixin-deep":"^1.1.3","vinyl-item":"^1.0.0"},"devDependencies":{"event-stream":"^3.3.4","gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"04093e70db117b2998d1aead6251fd56a69f84ff","_id":"vinyl-view@1.0.0","_shasum":"292c56bccf026df0ecf84ae60a7903464055ee08","_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":"292c56bccf026df0ecf84ae60a7903464055ee08","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-1.0.0.tgz","integrity":"sha512-OCI54QkBhjvsplgH7+vs6kciXtI32ZpEtXzYlmzOfhjqJ3p2DNRGjqxt4Uk3gZzn0l3bb+wmwpZIUd7KsVvTCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4MdsTYnfrVjMkpCvS38NqhHgOPDSzniEPc/4+qJeRZAiEA86lBCH82uW9ZhLFrhDF6zB9r6fVPjFtAGhLXlZHzbzM="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vinyl-view-1.0.0.tgz_1482981127321_0.0028724533040076494"}},"2.0.0":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"2.0.0","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","isobject":"^3.0.0","lazy-cache":"^2.0.2","mixin-deep":"^1.1.3","vinyl-item":"^1.0.0"},"devDependencies":{"event-stream":"^3.3.4","gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"da68726b9602e7cf53f7a6a84391878b225ae779","_id":"vinyl-view@2.0.0","_shasum":"d02d7a4cfe35c6361eac602b1791e3867e5e5efe","_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":"d02d7a4cfe35c6361eac602b1791e3867e5e5efe","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-2.0.0.tgz","integrity":"sha512-8M70GnEocL4tr2571q+oaxrbypWRsfi7q69eE0NpM84Y+IkQL/2kzSyGVyZLoQFfroGd88TtZl8Y09uDn/Lvdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOXi0YYKmrHd+1xDkAZ+Asn1l54KC3vofIcXmXoeuGlAiEAjTv79xQgCnQlSzwYdJe+qMJCRGD0ywuWXcPwcGgSM1o="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vinyl-view-2.0.0.tgz_1486597186339_0.010268477024510503"}},"2.0.1":{"name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","version":"2.0.1","homepage":"https://github.com/jonschlinkert/vinyl-view","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-union":"^3.1.0","define-property":"^0.2.5","engine-base":"^0.1.2","extend-shallow":"^2.0.1","isobject":"^3.0.0","lazy-cache":"^2.0.2","vinyl-item":"^1.0.0"},"devDependencies":{"event-stream":"^3.3.4","gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"reflinks":["verb","vinyl"],"lint":{"reflinks":true}},"gitHead":"fdd525a1e8b2946903bb3af214121195f310bb2e","_id":"vinyl-view@2.0.1","_shasum":"46a4d99fa8688bf37912868f912665a15b66816a","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"46a4d99fa8688bf37912868f912665a15b66816a","tarball":"https://registry.npmjs.org/vinyl-view/-/vinyl-view-2.0.1.tgz","integrity":"sha512-bXSfolRtJEA7WGQnpRiHmgWzOML7thSClRlAtXGIEYwMmpFBnzso2U3Vq+WFMV6p9GY+QYtG8eeKl6GDpce97w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMBc5m6Ojy5EKp5u0nBdwjgG/GJD9Ec/V4YBGb06kXvAiAUd0MT/JUwFz64+YtO+GeGUqj6vjqH6VmBRPJ+7iKzkQ=="}]},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vinyl-view-2.0.1.tgz_1486658487449_0.9408573901746422"}}},"readme":"# vinyl-view [![NPM version](https://img.shields.io/npm/v/vinyl-view.svg?style=flat)](https://www.npmjs.com/package/vinyl-view) [![NPM monthly downloads](https://img.shields.io/npm/dm/vinyl-view.svg?style=flat)](https://npmjs.org/package/vinyl-view)  [![NPM total downloads](https://img.shields.io/npm/dt/vinyl-view.svg?style=flat)](https://npmjs.org/package/vinyl-view) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/vinyl-view.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/vinyl-view)\n\n> Extends vinyl with render and compile methods, and properties used for rendering templates.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save vinyl-view\n```\n\n## Usage\n\nUse the same way you would use a [vinyl](https://github.com/gulpjs/vinyl) file:\n\n```js\nvar View = require('vinyl-view');\nvar view = new View({path: 'foo'});\n```\n\n## API\n\n### [View](index.js#L26)\n\nCreate an instance of `View`. Optionally pass a default object to use.\n\n**Params**\n\n* `view` **{Object}**\n\n**Example**\n\n```js\nvar view = new View({\n  path: 'foo.html',\n  contents: new Buffer('...')\n});\n```\n\n### [.compile](index.js#L57)\n\nSynchronously compile a view.\n\n**Params**\n\n* `locals` **{Object}**: Optionally pass locals to the engine.\n* `returns` **{Object}** `View`: instance, for chaining.\n\n**Example**\n\n```js\nvar view = page.compile();\nview.fn({title: 'A'});\nview.fn({title: 'B'});\nview.fn({title: 'C'});\n```\n\n### [.renderSync](index.js#L75)\n\nSynchronously render templates in `view.content`.\n\n**Params**\n\n* `locals` **{Object}**: Optionally pass locals to the engine.\n* `returns` **{Object}** `View`: instance, for chaining.\n\n**Example**\n\n```js\nvar view = new View({content: 'This is <%= title %>'});\nview.renderSync({title: 'Home'});\nconsole.log(view.content);\n```\n\n### [.render](index.js#L101)\n\nAsynchronously render templates in `view.content`.\n\n**Params**\n\n* `locals` **{Object}**: Context to use for rendering templates.\n\n**Example**\n\n```js\nview.render({title: 'Home'}, function(err, res) {\n  //=> view object with rendered `content`\n});\n```\n\n### [.context](index.js#L132)\n\nCreate a context object from `locals` and the `view.data` and `view.locals` objects. The `view.data` property is typically created from front-matter, and `view.locals` is used when a `new View()` is created.\n\nThis method be overridden either by defining a custom `view.options.context` function\nto customize context for a view instance, or static [View.context](#view-context) function to customize\ncontext for all view instances.\n\n**Params**\n\n* `locals` **{Object}**: Optionally pass a locals object to merge onto the context.\n* `returns` **{Object}**: Returns the context object.\n\n**Example**\n\n```js\nvar page = new View({path: 'a/b/c.txt', locals: {a: 'b', c: 'd'}});\nvar ctx = page.context({a: 'z'});\nconsole.log(ctx);\n//=> {a: 'z', c: 'd'}\n```\n\n### [.isType](index.js#L148)\n\nReturns true if the view is the given `viewType`. Returns `false` if no type is assigned. When used with vinyl-collections, types are assigned by their respective collections.\n\n**Params**\n\n* `type` **{String}**: (`renderable`, `partial`, `layout`)\n\n**Example**\n\n```js\nvar view = new View({path: 'a/b/c.txt', viewType: 'partial'})\nview.isType('partial');\n```\n\n### [.View.context](index.js#L248)\n\nDefine a custom static `View.context` function to override default `.context` behavior. See the [context](#context) docs for more info.\n\n**Params**\n\n* `locals` **{Object}**\n* `returns` **{Object}**\n\n**Example**\n\n```js\n// custom context function\nView.context = function(locals) {\n  // `this` is the view being rendered\n  return locals;\n};\n```\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\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### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nMIT\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 08, 2017._","maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-28T17:32:42.957Z","created":"2016-06-01T15:35:36.298Z","0.1.0":"2016-06-01T15:35:36.298Z","0.1.1":"2016-07-23T21:11:58.318Z","0.1.2":"2016-07-23T21:14:18.297Z","1.0.0":"2016-12-29T03:12:07.885Z","2.0.0":"2017-02-08T23:39:48.228Z","2.0.1":"2017-02-09T16:41:28.095Z"},"homepage":"https://github.com/jonschlinkert/vinyl-view","keywords":["assemble","collection","compile","context","engine","handlebars","render","template","templates","view","views","vinyl"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT","readmeFilename":"README.md"}