nice-registry / nice-package

📦 Clean up messy package metadata from the npm registry
35 stars 7 forks source link

FR: Integrate request. #2

Closed hemanth closed 8 years ago

hemanth commented 8 years ago

It be useful to have some like:

const package = require('nice-package')

package(module)
.then(pkg => console.log(JSON.stringify(pkg, null, 2))
.catch(err => console.err(`No such module: ${module}`)

instead of

const got = require('got')
const Package = require('nice-package')

got('https://registry.npmjs.com/express', {json:true})
  .then(function(doc) {
    var pkg = new Package(doc)
    console.log(JSON.stringify(pkg, null, 2))
  })

If yes, I am happy to do a PR @zeke.

zeke commented 8 years ago

I like this idea! Pull request welcome.

hemanth commented 8 years ago

This became a module in itself, thanks! 👍