package-repo
v1.0.0
Published
Give me a package.json and I'll tell you about its repository
Downloads
2,910
Maintainers
Readme
package-repo
Give this function a package.json object, or a path to a package.json file. It will look for a repository
or repository.url
key in the given object and attempt to parse it as a GitHub or BitBucket repository URL. See github-url-to-object and bitbucket-url-to-object for details about the object returned.
Installation
npm install package-repo --save
Usage
const packageRepo = require("package-repo")
packageRepo('./some/package.json')
// or
packageRepo(somePackage)
/*
{
user: 'monkey',
repo: 'business',
branch: 'master',
tarball_url: 'https://api.github.com/repos/monkey/business/tarball/master',
clone_url: 'https://github.com/monkey/business',
https_url: 'https://github.com/monkey/business',
travis_url: 'https://travis-ci.org/monkey/business',
api_url: 'https://api.github.com/repos/monkey/business'
zip_url: 'https://github.com/monkey/business/archive/master.zip'
}
*/
Tests
npm install
npm test
Dependencies
- bitbucket-url-to-object: Extract user, repo, and other interesting properties from Bitbucket URLs
- github-url-to-object: Extract user, repo, and other interesting properties from GitHub URLs
Dev Dependencies
- chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- mocha: simple, flexible, fun test framework
- require-dir: Helper to require() directories.
- snazzy: Format JavaScript Standard Style as Stylish (i.e. snazzy) output
License
MIT
Generated by package-json-to-readme