@hankchanocd/npmlist

Search npm modules' dependencies.


Keywords
npm, cli, list, latest, dependencies, fuzzy-search, npmlist
License
ISC
Install
npm install @hankchanocd/npmlist@8.0.2

Documentation

npmlist

npm node David David

install size Build Status Github issues Known Vulnerabilities Commitizen friendly

Search npm modules' dependencies.

 

npmlist is a library providing searching and parsing dependencies, global installs, scripts, profile. It empowers many CLI apps, i.e. npm-fzf.

Requirements

npmlist requires Node 8 or above for runtime.

API

Install

$ npm install @hankchanocd/npmlist

Examples

Search npm modules

const { npmSearch } = require("@hankchanocd/npmlist");

let module = ['express'];
npmSearch(module)
	.then(i => i.raw())
	.then(i => yourFunction)
	.catch(err => console.log(err));

// 92 express@4.16.4 express framework sinatra web rest restful router app api
// 91 path-to-regexp@2.4.0 express regexp route routing

List local dependencies

const { npmDependencies } = require("@hankchanocd/npmlist");
const { npmList } = npmDependencies;

npmList()
	.raw()
	.then(i => yourFunction)
	.catch(err => console.log(err));

// @express@1.0.0
// ├── Dependencies
// ├── chalk@2.4.1

List npm module's scripts

const { npmScripts } = require("@hankchanocd/npmlist");

npmScripts()
	.raw()
	.then(i => yourFunction)
	.catch(err => console.log(err));

// @express@1.0.0
// build => babel src/ -d build/ --quiet
// commit => git-cz

npmlist has a few distinct advantages:

  1. npmSearch() searches for npm modules with npms.io, a better npm search engine than npm search with score analysis.
  2. npmList() is a replacement for painfully long and slow npm list --depth=0 --local and other npm list --@#$% commands
  3. npmScripts() lists npm scripts better than npm run-script
  4. npmRecent() gives a quick refresher on the recent global installs
  5. npmGlobal() finds and prints global modules as fancy as brew list, and more than 10x faster than npm list -g

Read API doc to find out more.

Tests

To perform unit tests and integration tests, simply run npm test.

Changelog

CHANGELOG

Contribution

npmlist started off as a bunch of CLI aliases on top of npm list and npm info, but grew larger quickly. It's now very effective at checking a package's dependencies and global installs. This is to say we are not afraid of expanding npmlist features beyond the current realm.

The roadmap for npmlist now focuses on serving as a library to provide a quick and concise report on terminal, freeing developers from the burden of constant switching between terminal and browser. See Wiki for npmlist's code architecture, developments rules, and styles. See here on how to contribute.

Use Cases

npm-fzf - Fuzzy search npm modules with fzf

License

ISC