contributor
A simple module to add git contributors to your package.json.
Last updated 6 years ago by jakeleboeuf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install contributor 
SYNC missed versions from official npm registry.

#Contributor Build Status GitHub version A simple node module to grab your project contributors from your github repo and add them to your package.json. You'll also be prompted to generate a Markdown version of your contributors list and save it to contributors.md.

Install from npm

$ npm install contributor -g

or add it as one of your projects package.json dependencies like this:

{
  ...
  "dependencies": {
    "contributor": "0.1.x"
  }
}

Usage

To get a record of your project's contribution info from your github repo, cd into the directory containing your package.json and run:

$ contributor

Bingo! Your package.json will be appended with something like this:

{
  ...
  "contributors": [
    {
      "name": "Jake LeBoeuf",
      "email": "dev@jakeleboeuf.com",
      "url": "https://github.com/jakeleboeuf",
      "contributions": 20,
      "hireable": true
    }
  ]
}

As of v0.1.12, you'll be prompted to optionally Save to contributors.md? (yes/no).

Prompt

contributors.md Preview

It should look all spiffy, but unfortunaly I realized after pushing this that github does not support custom text colors and neato things. lame. I'll fix it someday.


***Screenshot of intended Markdown***

Preview

Behind the scenes

Contributor hunts for repository.url in your your package.json. If it finds a valid repo url, it requests collaborator info from the github api and adds it to your package.json. Super simple. If your repo is private, you'll be prompted for your Github username/password.

$ contributor will always make a backup of your original json to .package.json, so all your secret codes are safe.

Pro tip: Add a git push alias and kill a couple birds.

$ git config alias.pushc \!git push $1 $2 && contributor

This will simply add the pushc alias to your .git/config file like so:

[alias]
	pushc = !git push $1 $2 && contributor

Then you can run git pushc origin master, and voila! Give it a try on your next project and let me know what you think!

-- ###Examle output

package.json Before $ contributor:

{
  "author": "Jake LeBoeuf",
  "name": "contributor",
  "description": "Example package.json.",
  "version": "0.1.1",
  "homepage": "https://github.com/jakeleboeuf/contributor",
  "repository": {
    "type": "git",
    "url": "https://github.com/jakeleboeuf/contributor.git"
  },
  "bugs": {
    "url": "https://github.com/jakeleboeuf/contributor/issues"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.4.x"
  },
  "dependencies": {
    "request": "2.34.x",
    "ansi-color": "0.2.x",
    "github": "0.1.x",
    "prompt": "0.2.x"
  }
}

package.json After $ contributor:

{
  "author": "Jake LeBoeuf",
  "name": "contributor",
  "description": "Example package.json.",
  "version": "0.1.1",
  "homepage": "https://github.com/jakeleboeuf/contributor",
  "repository": {
    "type": "git",
    "url": "https://github.com/jakeleboeuf/contributor.git"
  },
  "bugs": {
    "url": "https://github.com/jakeleboeuf/contributor/issues"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.4.x"
  },
  "dependencies": {
    "request": "2.34.x",
    "ansi-color": "0.2.x",
    "github": "0.1.x",
    "prompt": "0.2.x"
  },
  "contributors": [
    {
      "name": "Jake LeBoeuf",
      "email": "dev@jakeleboeuf.com",
      "url": "https://github.com/jakeleboeuf",
      "contributions": 20,
      "hireable": true
    }
  ]
}

Support via Gittip

NPM

Current Tags

  • 0.1.25                                ...           latest (6 years ago)

51 Versions

  • 0.1.25                                ...           6 years ago
  • 0.1.24                                ...           6 years ago
  • 0.1.23                                ...           6 years ago
  • 0.1.22                                ...           6 years ago
  • 0.1.21                                ...           6 years ago
  • 0.1.20                                ...           6 years ago
  • 0.1.19                                ...           6 years ago
  • 0.1.18                                ...           6 years ago
  • 0.1.16                                ...           7 years ago
  • 0.1.15                                ...           7 years ago
  • 0.1.14                                ...           7 years ago
  • 0.1.13                                ...           7 years ago
  • 0.1.12                                ...           7 years ago
  • 0.1.11                                ...           7 years ago
  • 0.1.10                                ...           7 years ago
  • 0.1.9                                ...           7 years ago
  • 0.1.8                                ...           7 years ago
  • 0.1.7                                ...           7 years ago
  • 0.1.6                                ...           7 years ago
  • 0.1.5                                ...           7 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0-2                                ...           7 years ago
  • 0.1.0-1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.22                                ...           7 years ago
  • 0.0.21                                ...           7 years ago
  • 0.0.20                                ...           7 years ago
  • 0.0.19                                ...           7 years ago
  • 0.0.17                                ...           7 years ago
  • 0.0.16                                ...           7 years ago
  • 0.0.15                                ...           7 years ago
  • 0.0.14                                ...           7 years ago
  • 0.0.13                                ...           7 years ago
  • 0.0.12                                ...           7 years ago
  • 0.0.11                                ...           7 years ago
  • 0.0.10                                ...           7 years ago
  • 0.0.9                                ...           7 years ago
  • 0.0.8                                ...           7 years ago
  • 0.0.7                                ...           7 years ago
  • 0.0.6                                ...           7 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.4-1                                ...           7 years ago
  • 0.0.4                                ...           7 years ago
  • 0.0.3-2                                ...           7 years ago
  • 0.0.3-1                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 3
Last Month 5
Dependencies (5)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |