Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use npm-registry-client instead of npm #33

Open
indexzero opened this issue Nov 20, 2013 · 3 comments
Open

Use npm-registry-client instead of npm #33

indexzero opened this issue Nov 20, 2013 · 3 comments

Comments

@indexzero
Copy link

Since you're only using npm.commands.view it would be better to just use something like:

var RegClient = require('npm-registry-client')
var client = new RegClient(config)

client.get("npm", "latest", 1000, function (er, data, raw, res) {
  // error is an error if there was a problem.
  // data is the parsed data object
  // raw is the json string
  // res is the response from couch
})

npm-registry-client is the library depended on by npm to fetch things from the registry. Why is this better?

  1. Reduces dependencies: As a library about dependencies this should be self-explanatory :-D
  2. More configurable: If I wanted to use david to check against two different registries I am currently limited by what is on disk in .npmrc when you call npm.load

I would make a PR for this if you're interested.

@alanshaw
Copy link
Owner

Absolutely - that would be incredible

@davglass
Copy link
Contributor

@indexzero if you don't have time, I'll totally do this as I'm looking to use this internally :)

@indexzero
Copy link
Author

@davglass totally. We're not leaning as hard on this anymore. Using https://github.com/3rd-eden/shrinkwrap mostly now.

... keep up the great work tho @alanshaw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants