vinyl-collection v0.1.1
vinyl-collection

Create a collection for vinyl files.
Install
Install with npm:
$ npm install --save vinyl-collectionUsage
var Collection = require('vinyl-collection');API
Collection
Create a new Collection with the given options.
Params
options{Object}
Example
var collection = new Collection();.file
Create a vinyl file.
Params
key{String|Object}: Optionally define akeyto use if the file will be cached.file{Object}: Object or instance of vinyl.returns{Object}
Example
var file = collection.file('foo', {path: 'a/b/c.js'});.addFile
Add a file to the collection.
Params
key{String|Object}: Either thekeyto use for caching the file, or a vinylfileobjectfile{Object}: Object or instance ofVinylreturns{Object}: Returns the instance for chaining
Example
collection.addFile('foo', {path: 'a/b/c.js'});.addFiles
Add an object or array of files to the collection.
Params
files{Array|Object}returns{Object}: Returns the instance for chaining
Example
collection.addFiles(files);.getFile
Get a file from the collection.
Params
key{String|Object}: The key of the file to get. Ifkeyis afileobject it is returned.returns{Object}: Returns thefileif found
Example
var file = collection.getFile('foo');.isFile
Returns true if file is a collection file object.
Params
file{Object}returns{Boolean}
Example
console.log(collection.isFile('foo'));
//=> false
console.log(collection.isFile(new Vinyl({path: 'foo'})));
//=> false
console.log(collection.isFile(collection.file({path: 'foo'})));
//=> true.isFile
Static method, returns true if file is a collection file object.
Params
file{Object}returns{Boolean}
Example
console.log(Collection.isFile('foo'));
//=> false
console.log(Collection.isFile(new Vinyl({path: 'foo'})));
//=> false
console.log(Collection.isFile(collection.file({path: 'foo'})));
//=> trueContributing
This document was generated by verb-readme-generator (a verb generator), please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Or visit the verb-readme-generator project to submit bug reports or pull requests for the readme layout template.
Building docs
Generate readme and API documentation with verb:
$ npm install -g verb verb-readme-generator && verbRunning tests
Install dev dependencies:
$ npm install -d && npm testAuthor
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on June 15, 2016.