Open pdehaan opened 8 years ago
nice-package
has some validation in place for this:
http://github.com/zeke/nice-package/blob/d5635bc04dce9b28409c7aba77ad614e2453dcc3/index.js#L42-L49
And here's the schema it uses:
properties: {
name: {
type: 'string',
required: true
},
description: {
type: 'string',
required: true
}
}
Note that this is different from the official npm notion of a valid package, which I think just requires name
and version
.
See also package-stream, another thing I made for accessing all the packages in the registry.
I'm open to ideas about when and how to (in)validate packages in all-the-packages
, if at all.
Not sure if valid bug, or if it's your job to be the package sheriff, but I got a couple errors due to my garbage coding, because it turns out now all packages in the npm registry have a
name
(go figure).Steps to reproduce:
Output:
Anyways, not sure if you want to emit the
package
event only if thepkg.value
in question passes some basic schema (ie: has aname
andversion
property). :shrug: