GithubHelp home page GithubHelp logo

vvo / package-stream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nice-registry/package-stream

0.0 2.0 0.0 4 KB

An endless stream of clean package data from the npm registry.

Home Page: http://npm.im/package-stream

JavaScript 100.00%

package-stream's Introduction

package-stream

An endless stream of clean package data from the npm registry.

See also all-the-packages, a similar package designed for offline use.

Installation

npm install package-stream --save

Usage

The stream is an event emitter that emits two events: pkg and up-to-date. The up-to-date event is emitted when the stream reaches the end of all existing packages, but unlike typical read streams, this stream has no end event. It remains open indefinitely, emitting package events as new package versions are published to the npm registry in real time.

var registry = require('package-stream')()

registry
  .on('package', function (pkg) {
    // nice clean package object
  })
  .on('up-to-date', function () {
    // consumed all changes (for now)
    // The stream will remain open and continue receiving package
    // updates from the registry as they occur in real time.
  })

Options

The changes-stream package is used under the hood, and all of its options are supported by package-stream. The default options used by package-stream are:

{
  db: 'https://skimdb.npmjs.com/registry',
  include_docs: true
}

The options you provide are merged with the defaults above.

Convenience Methods

Each package instance has convenience methods like pkg.dependsOn(pkgName) and pkg.mentions(query). To see the full list, check out the nice-package documentation.

Tests

npm install
npm test

Dependencies

  • changes-stream: Simple module that handles getting changes from couchdb
  • got: Simplified HTTP requests
  • nice-package: Clean up messy package metadata from the npm registry

Dev Dependencies

  • tap-spec: Formatted TAP output like Mocha's spec reporter
  • tape: tap-producing test harness for node and browsers

License

MIT

Generated by package-json-to-readme

package-stream's People

Contributors

zeke avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.