Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to npm #13

Open
stephenhandley opened this issue Jul 7, 2013 · 4 comments
Open

add to npm #13

stephenhandley opened this issue Jul 7, 2013 · 4 comments

Comments

@stephenhandley
Copy link

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

@sdether
Copy link
Owner

sdether commented Jul 7, 2013

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
Copy link

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants