update-contributors v0.3.1
update-contributors
Update contributors property in package.json with current github contributors.
CLI
$ npm install -g update-contributors
After globably installing, run update-contrib
at the commandline from a repository.
This will add any contributors found on github to the contributors
array inside package.json
.
Warning the repository
property needs to be in the package.json
following one of the github formats found in the npm docs
$ update-contrib
Update
When installed globally, update-contributors will work with update and run automatically.
$ update
Usage
Install with npm
$ npm i update-contributors --save
var update = require('update-contributors');
API
update
Pulldown github contributors and update the contributors
property in the provided package.json object.
Params
pkg
{Object}: Object representing the package.json to update.options
{Object}: Options to use for github authentication.options.creds
{Object}: Github credentials. May be a token or a username and password. If execuled ask-for-github-auth will be used.options.stringify
{Boolean}: When set tofalse
the contributors will be objects in thecontributors
array. Defaults totrue
.cb
{Function}: Callback function that will get anerr
when an error happens or aresults
with the updated package.json object.
Example
var pkg = require('./package.json');
update(pkg, function (err, results) {
if (err) return console.error(err);
console.log(reults);
//=> updated package.json object
});
Related projects
- github-base: Base methods for creating node.js apps that work with the GitHub API. | homepage
- github-contributors: Generate a markdown or JSON list of contributors for a project using the GitHub API. | homepage
- stringify-author: Stringify an authors object to
name <email> (url)
. | homepage
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb-cli on November 17, 2015.