1.0.0 • Published 8 years ago

get-pkg-json v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

get-package-json

Get a package.json, from either a npm registry or github

Installation

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

npm install get-package-json --save

Usage

import getPackageJson from 'get-package-json';

// can be a git url
getPackageJson('git+https://github.com/kesla/get-package-json.git')
  .then(packageJson => {
    console.log('packageJson', packageJson);
  });

// can be a npm arg
getPackageJson('get-package-json@latest')
  .then(packageJson => {
    console.log('packageJson', packageJson);
  });

// can also load a cached version
const cached = getPackageJson.cached();
cached('git+https://github.com/kesla/get-package-json.git')
  .then(packageJson => {
    console.log('packageJson', packageJson);
    cached('git+https://github.com/kesla/get-package-json.git')
      .then(packageJson => {
        console.log('cached package.json', packageJson);
      });
  });

Tests

npm install
npm test

Dependencies

Dev Dependencies

License

MIT

Generated by package-json-to-readme