package-stream
An endless stream of nice 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: package
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.
const registry = registry
Nice Packages
Each object emitted by the package
event is a
nice-package instance.
Nice packages have cleaner metadata than you'd get directly from the npm
registry, and some handy
convenience methods
.
Here's an example that uses the
somehowDependsOn()
method to find all packages the have choo
in their dependencies
or
devDependencies
:
const registry = const dependents = registry
To see the full list of available methods, check out the nice-package documentation.
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://replicate.npmjs.com' include_docs: true
The options you provide are merged with the defaults above.
Tests
npm installnpm 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