Skip to content

zeke/package-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

Give me a package.json and I'll tell you about its repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published