All-star lineup of Node-based FOSS contributors
all-stars is meant to be a lightweight data module containing pre-fetched author info for the maintainers of the top depended Node packages on npm.
Inspired by credits, all-stars was created to recognize some of the most prolific authors of Node-based FOSS, to honor them for the awesome work they've done that benefits us all.
One of the problems of giving credit where it is due is that any individual author may be known by several names. Sometimes authors change usernames or email addresses. Sometimes they use their real name, sometimes not. all-stars is designed to address this problem, combining pre-fetched, cross-referenced data with a simple API to resolve many possible identifiers to a known author.
all-stars can resolve any of the following to a known author with a single method:
- name or alias
- email address
- npm username
- GitHub username
If an author is resolved, an object representing that author is returned, containing the following information:
- all known names
- all known email addresses
- all known npm usernames
- all known GitHub usernames
- all known Twitter handles
Hopefully this can help normalize arbitrary string-based ids into a more usable structure (and reduce duplicates in credits).
Note that the data in this module was fetched from public resources that are freely available, but it could possibly be used for ill intent. Please be respectful and DBAD! Thanks.
npm install --save all-stars
var allStars =
Resolve author by string
var rvagg =console//=> Rod Vagg <firstname.lastname@example.org> (npm: rvagg, GitHub: rvagg, Twitter: rvagg)var othiym23 =console//=> Forrest L Norvell <email@example.com>var substack =console//=> [ 'firstname.lastname@example.org', 'email@example.com' ]var jongleberry =console//=> [ 'jongleberry', 'jonathanong' ]var tj =console//=> [ 'tj' ]var bcoe =console//=> [ 'Benjamin Coe', 'Ben Coe', 'Benjamin E. Coe' ]var sindre =console//=> [ 'sindresorhus' ]
Resolve author by array
Iterates over elements and returns first match.
var indutny =console//=> Fedor Indutny <firstname.lastname@example.org> (npm: indutny, GitHub: indutny, Twitter: indutny)
Resolve author by object
Iterates over object property values and returns first match.
var domenic =console//=> Domenic Denicola <email@example.com>
Synchronously resolve query to an individual author, if known.
query: string|array|object, identifier(s) to resolve
Object returned from
allStars() method. Contains the following:
emails: array of strings (may be null), all known email addresses
githubUser: string (may be null), first GitHub username from array
githubUsers: array of strings (may be null), all known GitHub usernames
id: string, identifying key of this author, typically the preferred npm username
name: string (may be null), first name from names array
names: array of strings (may be null), all known names
npmUser: string (may be null), first npm username from array
npmUsers: array of strings (may be null), all known npm usernames
subset: function, returns an object as a subset of this object. Useful for assigning or merging with another object. The subset object contains:
name: string or null, same as
npm: string or null, same as
github: string or null, same as
summary([all]): function, returns first value from each array, concatenated as string
trueif you want all fields,
falseif you just want name and email
toString(): function, alias for
twitters: array of strings (may be null), all known Twitter handles
The git repository contains CLI tools for fetching and generating the static data that is packaged within this module. The approach was intended to be as objective as possible, though some guidance for accurate cross-referencing or gap-filling proved necessary. Here's the basic process:
Fetch top depended packages, scraped from npm's website
cli/genPackages.js. Number of packages to fetch is configurable but defaults to 150.
Package list is written to
generated/packages_YYYYMMDD_HHmmss.json, which can be copied to
Fetch author info for a given set of packages
cli/genAuthors.js. Package list to fetch authors for is configurable but defaults to the most recent generated packages json file.
Attempts to collect names, emails, and usernames from the following locations:
Package maintainer info, pulled from registry.npmjs.org
Curated set of aliases from this module's source code (
npm user profile, scraped from npm's site
GitHub user profile, using GitHub's API
Author info is written to
generated/authors_YYYYMMDD_HHmmss.json, which can be copied to
Note that this process sends many concurrent requests that can accidentally DoS attack the resources (particularly npm). May need to run a few different times until no 503s are received. To avoid throttling by GitHub's API, you will need to provide a Personal Access Token, which can either be specified via CLI or exported as
After author data has been generated and copied over to
prepublish script should be run to create an
index_authors.json file, which
is used by the main API. This is accomplished via
npm run prepublish.
ISC © Andrew Goode and Contributors