npm-to-github
Get the GitHub repository from a npm package
Last updated 8 years ago by oliviercoilland .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-to-github 
SYNC missed versions from official npm registry.

npm-to-github

Get the GitHub repository from a npm package.

Installation

$ npm install npm-to-github --save

Usage

const npmToGitHub = require('npm-to-github');

Get repository name

npmToGitHub.getRepositoryName('npm-to-github')
.then((name) => {
    console.log(name);
})
.catch((error) => {
    console.log(error);
});

Get repository data

npmToGitHub.getRepository('npm-to-github')
.then((data) => {
    console.log(data);
})
.catch((error) => {
    console.log(error);
});

GitHub API rate limit

GitHub API is limited to 60 requests, after which you get an error:

API rate limit exceeded for a.b.c.d. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

A work around is to authenticate. npm-to-github supports token based authentication. The token doesn't need any scope or permission.

const npmToGitHub = require('npm-to-github');
npmToGitHub.setToken('d5ea195..........................4bde396');

Incompatible API changes! (f34r)

In 1.x errors where not really errors, only a message. In 2.x errors are full Error objects.

License

Released under the MIT license.

Current Tags

  • 2.1.1                                ...           latest (8 years ago)

5 Versions

  • 2.1.1                                ...           8 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |