npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vinyl-collection

v0.1.1

Published

Create a collection for vinyl files.

Readme

vinyl-collection NPM version NPM downloads Build Status

Create a collection for vinyl files.

Install

Install with npm:

$ npm install --save vinyl-collection

Usage

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 a key to 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 the key to use for caching the file, or a [vinyl][] file object
  • file {Object}: Object or instance of Vinyl
  • returns {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. If key is a file object it is returned.
  • returns {Object}: Returns the file if 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'})));
//=> true

Contributing

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 && 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, v0.9.0, on June 15, 2016.