{"_id":"vinyl-view","_rev":"231839","name":"vinyl-view","description":"Extends vinyl with render and compile methods, and properties used for rendering templates.","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T15:46:42.000Z","created":"2016-06-01T15:35:36.298Z","2.0.1":"2017-02-09T16:41:28.095Z","2.0.0":"2017-02-08T23:39:48.228Z","1.0.0":"2016-12-29T03:12:07.885Z","0.1.2":"2016-07-23T21:14:18.297Z","0.1.1":"2016-07-23T21:11:58.318Z","0.1.0":"2016-06-01T15:35:36.298Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/vinyl-view.git"},"versions":{"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","size":4630,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-2.0.1.tgz"},"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"},"directories":{},"publish_time":1486658488095,"_cnpm_publish_time":1486658488095,"_hasShrinkwrap":false},"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":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"d02d7a4cfe35c6361eac602b1791e3867e5e5efe","size":4663,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vinyl-view-2.0.0.tgz_1486597186339_0.010268477024510503"},"directories":{},"publish_time":1486597188228,"_cnpm_publish_time":1486597188228,"_hasShrinkwrap":false},"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":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"292c56bccf026df0ecf84ae60a7903464055ee08","size":4674,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vinyl-view-1.0.0.tgz_1482981127321_0.0028724533040076494"},"directories":{},"publish_time":1482981127885,"_cnpm_publish_time":1482981127885,"_hasShrinkwrap":false},"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":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"09ac6d7c801212bf0926bd9d4106f45e6c4fc977","size":4636,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.2.tgz_1469308456160_0.1579292444512248"},"directories":{},"publish_time":1469308458297,"_cnpm_publish_time":1469308458297,"_hasShrinkwrap":false},"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":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"54adb92b3cc5798e772c03cc5ba183815ed9463c","size":4635,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-0.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.1.tgz_1469308316317_0.13928566430695355"},"directories":{},"publish_time":1469308318318,"_cnpm_publish_time":1469308318318,"_hasShrinkwrap":false},"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":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5954e4322667fb8e8f2711b29be17530117a5c05","size":3622,"noattachment":false,"key":"/vinyl-view/-/vinyl-view-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/vinyl-view/download/vinyl-view-0.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vinyl-view-0.1.0.tgz_1464795335143_0.9860407602973282"},"directories":{},"publish_time":1464795336298,"_cnpm_publish_time":1464795336298,"_hasShrinkwrap":false}},"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._","_attachments":{},"homepage":"https://github.com/jonschlinkert/vinyl-view","bugs":{"url":"https://github.com/jonschlinkert/vinyl-view/issues"},"license":"MIT"}