dominictarr / npmd

MIT License
450 stars 37 forks source link

Npmd readme #28

Closed fraserxu closed 10 years ago

fraserxu commented 10 years ago

Add script to load readme file from db according to the module name.

npmd readme npmd

dominictarr commented 10 years ago

Great! thanks!

You don't need to use streams for this, can you simplify this to:

db.sublevel('pkg').get(module, function (err, data) {
  if(err) return cb(err)
  console.log(data.readme)
  cb(null, data.readme)
})

can you update and then I'll merge!

fraserxu commented 10 years ago

Hi, @dominictarr I have tried to test some modules with node index.js readme modluename on my local, but I can't read some of them like JSONStream, but it works for others like npmd, npmd-install.

I console.log the data from JSONStream:

➜  npmd git:(npmd-readme) ✗ node index.js readme JSONStream
{ name: 'JSONStream',
  description: 'rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)',
  author:
   { name: 'Dominic Tarr',
     email: 'dominic.tarr@gmail.com',
     url: 'http://bit.ly/dominictarr' },
  repository:
   { type: 'git',
     url: 'git://github.com/dominictarr/JSONStream.git' },
  maintainers: [ { name: 'dominictarr', email: 'dominic.tarr@gmail.com' } ],
  time:
   { created: '2011-09-23T11:01:36.806Z',
     modified: '2013-09-01T11:04:04.220Z' } }

Do you have any idea why there's no readme file in these modlues?

dominictarr commented 10 years ago

Cool! this published in version 0.13.0 hmm. JSONStream is an old module, written before npm started storing the readme in the registry. I bet it's something to do with that...

Probably it's in the couch-sync code that pulls down the readmes... I'll have a look into this...