Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinyl-item

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl-item

Extends vinyl files with properties used in vinyl-collections.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
decreased by-0.37%
Maintainers
1
Weekly downloads
 
Created
Source

vinyl-item NPM version NPM monthly downloads NPM total downloads Linux Build Status

Extends vinyl files with properties used in vinyl-collections.

Install

Install with npm:

$ npm install --save vinyl-item

Usage

Use the same way you would use a vinyl file:

var Item = require('vinyl-item');
var item = new Item({path: 'foo'});

API

Item

Create an instance of Item. Optionally pass a default object to use. See vinyl docs for API details and additional documentation.

Example

var item = new Item({
  path: 'foo.html',
  contents: new Buffer('...')
});

Params

  • item {Object}

.content

Normalize the content and contents properties on item. This is done to ensure compatibility with the vinyl convention of using contents as a Buffer, as well as the assemble convention of using content as a string. We will eventually deprecate the content property.

Example

var item = new Item({path: 'foo/bar.hbs', contents: new Buffer('foo')});
console.log(item.content);
//=> 'foo'

.engine

Getter/setter to resolve the name of the engine to use for rendering.

Example

var item = new Item({path: 'foo/bar.hbs'});
console.log(item.engine);
//=> '.hbs'

About

  • assemble: Get the rocks out of your socks! Assemble makes you fast at creating web projects… more | homepage
  • templates: System for creating and managing template collections, and rendering templates with any node.js template engine… more | homepage
  • verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage
  • vinyl: Virtual file format. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)

To generate the readme and API documentation with verb:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb-generate-readme, v0.2.0, on December 28, 2016.

Keywords

FAQs

Package last updated on 29 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc