Open stephenhandley opened 11 years ago
Sounds like a good idea. I have no experience with packaging for NPM, especially not client side libs. If you can provide a pull request it would help. Otherwise, if you have some resources on how to proceed at them to the issue and I'll try to get to it.
This is very easy. Have a look at this little guide. https://gist.github.com/coolaj86/1318304
I could send a pull request, but it's really no point because the package.json file should be configured by the author.
Basically, you'll have a local tool named npm
that you use to manage your package.
# Setup your package:
npm init
# Make it modular...
git add ...
git commit -m "..."
# Publish
npm publish
With modular, I mean that your code exports something:
// module.exports is an object. Anything attached to it, is exported.
module.exports = Josh;
You can test if you are in a browser or "modular" environment:
if(typeof module == "object") {
module.exports = ...;
} else {
window.something = ...;
}
Well NPM is the package manager of Node.js. So if you have node.js installed it comes with that.
any interest in adding this to NPM so it can get bundled for client side code via browserify or similar libs.