Socket
Book a DemoInstallSign in
Socket

depnames

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depnames

Fetch a list of dependency names for a given npm package

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

depnames

Fetch a list of dependency names for a given npm package

Uses fetch-nice-package and nice-package under the hood.

Installation

Node 8 or greater is required because this module uses async functions.

npm i -g depnames

Module Usage

This module exports a single function which expects a package name and returns a promise. The resolved value is an array of package name strings:

require('depnames')('cheerio')
  .then(names => console.log(names))

To fetch dev dependencies, set the dev option:

require('depnames')('cheerio', {dev: true})
  .then(names => console.log(names))

If you need more flexibility, see fetch-nice-package and nice-package.

CLI Usage

The CLI prints a newline-delimited list to standard out:

depnames budo

bole
browserify
chokidar
connect-pushstate
escape-html
...

This newline pattern plays nicely with tools like the ghub CLI.

The following command will open every dependency's repository page in a browser tab:

npm i -g ghub depnames
depnames express | ghub

Pass the --dev flag to list devDependencies:

depnames budo --dev

2d-context
babel-preset-es2015
babelify
brfs
canvas-loop
...

Tests

npm install
npm test

Dependencies

  • fetch-nice-package: fetch cleaned package metadata from the npm registry.
  • minimist: parse argument options

Dev Dependencies

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework
  • nixt: Simple and powerful testing for command-line apps
  • standard: JavaScript Standard Style
  • standard-markdown: Test your Markdown files for Standard JavaScript Style™

License

MIT

FAQs

Package last updated on 27 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts