Skip to content

npm-api plugin for streaming an npm module's dependents information

License

Notifications You must be signed in to change notification settings

doowb/npm-api-dependents

Repository files navigation

npm-api-dependents NPM version NPM monthly downloads NPM total downloads Linux Build Status Windows Build Status

npm-api plugin for getting module dependents.

Install

Install with npm:

$ npm install --save npm-api-dependents

Install with yarn:

$ yarn add npm-api-dependents

Usage

var npm = require('npm-api')();
var dependents = require('npm-api-dependents');
npm.use(dependents());

var repo = npm.repo('micromatch');

// returns a readable stream
repo.dependents()
  .on('data', function(repo) {
    console.log(repo);
  });

API

Get the dependents for the current repo.

Params

  • options {Object}: Options to handle returned results
  • options.raw {Boolean}: Optional. Set to true to receive objects of the form { name: 'module' } instead of Repo objects.
  • returns {Stream}: Returns a readable stream (object mode).

Example

var repo = npm.repo('micromatch');

// returns a readable stream
repo.dependents()
  .on('data', function(repo) {
    console.log(repo);
  });

About

Contributing

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

Contributors

Commits Contributor
6 doowb
1 ralphtheninja

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Brian Woodward

License

Copyright © 2017, Brian Woodward. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on December 27, 2017.