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 🙏

© 2026 – Pkg Stats / Ryan Hefner

get-contributors

v0.4.0

Published

Get contributors from git, and generate a JSON list of contributors or a list base on a user defined template.

Readme

get-contributors npm

Build Status downloads license

Get contributors from git, and generate a JSON list of contributors or a list base on a user defined template.

  • The contributors is sorted by the contribution of the order.
  • It could show the commits and the percentage contribution in the project.
  • It could add customized fields to output
  • It could use a customized template format to output
  • It could search and assign the github user name from the email address of the contributor.
  • It could ask the user the information of the unknown fields(github etc) at the command line
  • It could write the new contributors to your contributors configuration file(.contributors)
  • It could merge multi-email addresses into one contributor if you've set on your contributors file(".contributors"). the ".contributors" file should be put into the current diretory if no specified position.

Changes

v0.4

  • the percentage contribution in the project should use the changes mainly:
    • contributions = commits*weight.commit(0.618) + insertions + deletions * weight.deletion(0.1)
  • weight option
  • branch option: the git branch to get the contributors.
  • path option: get the contributors of the specified path in the git's working directory

Usage

Usage get-contributors {OPTIONS}

Get contributors from git, and generate
a JSON list of contributors. or a list
base on a user defined template.


Options:
  -d, --dirname         The git project(git working dir) to get contributors. Default: $(pwd)
  -c, --config          The contrbutors configuration file. It uses the CSON format.
                        Default: ${pwd}/.contributors
  -b, --branch          get the contributors on the git branch.
                        Default: current branch(HEAD).
      --path            get the contributors on the specified path in the git's working directory.
                        Default: root dir(all).
  -g, --tryGithub       try to get the github user name from the email via Search the github.
                        Default: yes, --no-tryGithub to disable it.
  -p, --weight          the commits and deletion weight of contribution:
                        It means the weight of commits if it's a number.
                        Default: "commit:0.618,deletion:0.1".
  -w, --write           Write the contrbutors configuration file if it has new contrbutors comming.
                        Default: yes, --no-write to disable it.
  -e, --fields          The output fields name, separate via comma. Default: "name,github"
                        * name: the user name
                        * email: the user email address
                          the user can have many emails, see contributors configuration.
                        * github: the github user name(it could be used as a user id)
                        * commits: the commits count of this contributor
                        * percent: the percentage with the contribution
  -f, --format          The output format, the customized template, cson or json, Default: json
                        * template: the customized template via user
                        * json: the json format
                        * cson: the cson format
  -a, --ask             whether ask the user to input if it can not find the field(github,etc).
                        Default: yes, --no-ask to disable it.
  -t, --template        The template for the template format. It supports the simple template and
                        the complex template. the complex template has three parts, head template,
                        body template and tail template, the head and tail could be ignore. (you
                        should define this in the configuration file only)
                        Default:
                        <% _.forEach(contributors, function(contributor) {
                             var item = contributor.name
                             if (contributor.github)
                               item = "[" + item +"](https://github.com/" + contributor.github
                             print(" * " + item)
                           }
                        %>
                        Complex template(in the congfiguration file) example:
                        template: [
                        	'''
                        		| Contributor Name | Github |
                        		| ---------------  | ------ |

                        	'''
                        	'''
                        		| ${contributor.name} | ${contributor.github} |

                        	'''
                        ]
  -i, --info            Show configuration infomation.
  -h, --help            Show this help infomation.

The contributors configuration file(cson format):


dirname: '.'
tryGithub: false
write: false
fields: 'name,github'
template: [
	'''
		| Contributor Name | Github |
		| ---------------  | ------ |

	'''
	'''
		| ${contributor.name} | ${contributor.github ? "[" + contributor.github + "](https://github.com/" + contributor.github + ")" : "-"} |

	'''
]
users:
  Jame:
    name: 'Jame Smith'
    email: '[email protected]'
    github: 'jame'
    twitter: 'jame'
    url: 'https://www.xxx.com'
  Mike:
    name: 'Mike Smith'
    email: ['[email protected]', '[email protected]']
    github: 'mike'
    twitter: 'mike'

License

MIT