Skip to content

kesla/get-package-json-from-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-package-json-from-github

Get package.json from github

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install get-package-json-from-github --save

Usage

import getPackageJsonFromGithub from 'get-package-json-from-github';

getPackageJsonFromGithub('git+https://github.com/kesla/get-package-json-from-github.git')
  .then(packageJson => {
    console.log('packageJson', packageJson);
  });

// can also load a caching version

const cached = getPackageJsonFromGithub.cached();

cached('git+https://github.com/kesla/get-package-json-from-github.git')
  .then(packageJson => {
    console.log('packageJson', packageJson);
  });

Tests

npm install
npm test

Dependencies

  • fast-cache: Caches a method that returns a promise and does so really fast.
  • gh-got: Convenience wrapper for got to interact with the GitHub API
  • immutable-object-methods: Update normal plain javascript object, immutable style. Simlar to how immutable.js, seamless-immutable etc does it but a lot smaller and simpler.
  • npm-package-arg: Parse the things that can be arguments to npm install

Dev Dependencies

License

MIT

Generated by package-json-to-readme

About

Get a package.json from a npm module hosted on github

Resources

License

Stars

Watchers

Forks

Packages

No packages published