sdether / josh.js

Toolkit for building a bash-like shell in the browser, including full readline support
http://sdether.github.com/josh.js/
Apache License 2.0
390 stars 76 forks source link

add to npm #13

Open stephenhandley opened 11 years ago

stephenhandley commented 11 years ago

any interest in adding this to NPM so it can get bundled for client side code via browserify or similar libs.

sdether commented 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.

hooloovooo commented 8 years ago

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.

IngwiePhoenix commented 8 years ago

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 = ...;
}
hooloovooo commented 8 years ago

Well NPM is the package manager of Node.js. So if you have node.js installed it comes with that.