Giter Club home page Giter Club logo

get-package-json-from-registry's Introduction

get-package-json-from-registry

Get a package.json from the registry, cached.

module

npm install [--save] get-package-json-from-registry
import getPackageJson from 'get-package-json-from-registry';

// these 2 will result in one query to the registry since we have a cache
getPackageJson('snappy@2').then(json => console.log(json));
getPackageJson('snappy@~1.1.0').then(json => console.log(json));

// calls will be cached in this instance
const getPackageJsonCached = getPackageJson.cached();

// these 2 will result in one query to the registry since we have a cache
getPackageJsonCached('snappy@2').then(json => console.log(json));
getPackageJsonCached('snappy@~1.1.0').then(json => console.log(json));

cli

npm -g install get-package-json-from-registry

get-package-json-from-registry snappy@2
get-package-json-from-registry snappy@~1.1.0

get-package-json-from-registry's People

Contributors

greenkeeperio-bot avatar kesla avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

get-package-json-from-registry's Issues

Unhandled 404 error

I'm using download-npm-package to download dependencies of a project and I'm feeding this library invalid input at the moment (I believe). One results in an unhandled rejection and I don't see where the promise chain is broken:

(node:26572) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
    at stream.catch.then.data (P:\spodr\node_modules\get-npm-registry-package\node_modules\got\index.js:123:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:26572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)

This happens, for example, when trying to retrieve css-frameworks@git+https://[email protected]/ben-eb/css-frameworks.git

The weird part is that this warning is logged, but my own catch handler is invoked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.