npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nfo

v1.0.1

Published

npm info with inverted args for multiple pkg support

Downloads

9

Readme

nfo

npm info with inverted args for multiple pkg support

Build Status Coverage Status

Execute npm info against multiple packages all together. Useful for comparing the same field value across different published packages.

Since it just wraps npm info, it respects your registry config in .npmrc and works with private packages. No special command-line options needed. (It may also be slow for this reason.)

Note that npm info is just an alias for npm view or npm show.

Examples

Get dist-tags of multiple packages in one run:

$ nfo dist-tags yargs @slack/client yarn

yargs
{ latest: '6.5.0', next: '6.3.0-candidate' }

@slack/client
{ latest: '3.7.0', beta: '2.3.0-beta.2' }

yarn
{ latest: '0.18.1', rc: '0.18.0' }

Check published time:

$ nfo time which-module ansi-align

which-module
{ modified: '2016-06-06T05:54:13.093Z',
  created: '2016-06-06T05:54:13.093Z',
  '1.0.0': '2016-06-06T05:54:13.093Z' }

ansi-align
{ modified: '2016-06-06T20:14:39.942Z',
  created: '2016-04-30T17:43:23.016Z',
  '1.0.0': '2016-04-30T17:43:23.016Z',
  '1.1.0': '2016-06-06T20:14:39.942Z' }

Output aggregated results as JSON:

$ nfo dist.tarball standard browserify webpack -j | json
{
  "standard": {
    "field": "dist.tarball",
    "value": "https://registry.npmjs.org/standard/-/standard-8.6.0.tgz"
  },
  "browserify": {
    "field": "dist.tarball",
    "value": "https://registry.npmjs.org/browserify/-/browserify-13.1.1.tgz"
  },
  "webpack": {
    "field": "dist.tarball",
    "value": "https://registry.npmjs.org/webpack/-/webpack-1.14.0.tgz"
  }
}

Install

CLI

$ npm i -g nfo
$ nfo help
Usage: nfo [opts] <field> <package> [packages..]

Execute npm info <package> <field> for each package given.
If only one argument is given, it is assumed to be a package name; otherwise a <field> is required.

Arguments:
  <field>                 A dot-delimited path to a field in the JSON output of npm info.
                          This field will be extracted for each package given. Use . for all info.
                          Examples: time, dist-tags, dist.tarball

  <package> [packages..]  One or more package names, including scope and optional version number.
                          Example: yargs @slack/client [email protected]

Options:
  -j, --json              Output aggregated results as JSON
  -h, --help              Print this help text and exit
  -v, --version           Print nfo version and exit

Run npm help info for more details on acceptable arguments.

Module

$ npm i --save nfo
const nfo = require('nfo')
nfo(packages, field).then(results => console.log(results))

License

ISC © Contributors