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

grunt-git-authors

v3.2.0

Published

Generate a list of authors from the git history.

Downloads

13,130

Readme

grunt-git-authors

A grunt plugin for generating a list of authors from the git history.

Support this project by donating on Gratipay.

This project supports both a Node API and a Grunt API.

Grunt compatibility

v1.1.0+ is compatible with Grunt 0.4. If you're using Grunt 0.3, use v1.0.0.

Grunt API

Tasks

authors

Generates a list of authors in the form Name <email> in order of first contribution.

This task writes its output to the console, not to a file.

You can optionally run this task against a subdirectory:

grunt authors:path/to/directory

update-authors

Creates or updates the file AUTHORS.txt with the list of authors.

You can optionally run this task against a subdirectory (the AUTHORS.txt file will be placed inside that directory):

grunt update-authors:path/to/directory

update-contributors

Updates package.json with the list of authors.

You can optionally run this task against a subdirectory (the package.json file inside that directory will be used):

grunt update-contributors:path/to/directory

Config

authors.order

Define the order of the list of authors. The default ordering is by first contribution {order: "date"}. An alternative ordering is by number of contributions {order: "count"}.

NOTE: This config value is used for the update-authors task as well.

grunt.initConfig({
	authors: {
		order: "count"
	}
});

authors.prior

Define a list of authors that contributed prior to the first commit in the repo. This is useful if you've moved from another version control system.

NOTE: This config value is used for the update-authors task as well.

grunt.initConfig({
	authors: {
		prior: [
			"Jane Smith <[email protected]>",
			"John Doe <[email protected]>"
		]
	}
});

Node API

This module can also be used directly via require( "grunt-git-authors" ).

getAuthors( options, callback )

Gets the list of authors.

  • options (Object)
    • dir (String): Which directory to inspect for authors (defaults to ".").
    • priorAuthors (Array): An array of authors that contributed prior to the first commit in the repo.
    • order (String): Which criteria to use for ordering the authors. "date" will order by first contribution; "count" will order by number of contributions. Defaults to "date".
  • callback (function( error, authors )): A callback to invoke with the list of authors.
    • authors: An array of authors in the form of Name <email>.

updateAuthors( options, callback )

Creates or updates an authors file with all authors.

  • options (Object)
    • dir (String): Which directory to inspect for authors (defaults to ".").
    • priorAuthors (Array): An array of authors that contributed prior to the first commit in the repo.
    • order (String): Which criteria to use for ordering the authors. "date" will order by first contribution; "count" will order by number of contributions. Defaults to "date".
    • filename (String): Which file to create (defaults to "AUTHORS.txt").
    • banner (String): Text to place at the top of the file (defaults to "Authors ordered by first contribution").
  • callback (function( error, filename )`): A callback to invoke after writing the file.
    • filename: The path of the file that was written.

updatePackageJson( options, callback )

Updates package.json with all authors.

  • options (Object)
    • dir (String): Which directory to inspect for authors (defaults to ".").
    • priorAuthors (Array): An array of authors that contributed prior to the first commit in the repo.
    • order (String): Which criteria to use for ordering the authors. "date" will order by first contribution; "count" will order by number of contributions. Defaults to "date".
  • callback (function( error )`): A callback to invoke after writing the file.

Mailmap

This task respects mailmap, so if you have messy author info in your commits, you can correct the data in your mailmap and this task with output the cleaned up information. For more information, about using a mailmap, see the docs for git-shortlog or read Shane da Silva's blog post about Git Shortlog and Mailmap.

License

Copyright Scott González. Released under the terms of the MIT license.


Support this project by donating on Gratipay.