Skip to content

nice-registry/all-the-package-names

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Repository files navigation

all-the-package-names

A list of all the public package names on npm. The list is just a JSON file and can be used wherever.

Highlights

Install

npm install all-the-package-names

Usage

const names = require('all-the-package-names')

// Most-depended-on names are first. See what's popular!
names.slice(0, 5)
/*
[
  'mocha',
  'chai',
  'lodash',
  'grunt',
  'eslint'
]
*/

names.includes('superagent')
// => true

names.includes('crazy-new-package-name')
// => false

names.length
// => 286289

names.filter(name => name.includes('banana'))
// => [ 'banana', 'banana-banana', 'banana-split', ...]

CLI Usage

$ npm i -g all-the-package-names
$ all-the-package-names
mocha
chai
lodash
grunt
eslint
...

Common pitfalls

Note that while mixed-case package names are no longer allowed to be published to the npm registry, there are over 2800 legacy mixed-case packages, many of which have the same spelling as other existing lowercase packages. See nice-registry/mixed-case-package-names for the full list.

To avoid the mixed-case names when working with this data, just filter them out:

const names = require('all-the-package-names').filter(name => name === name.toLowerCase())