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

npm package #3

Closed
XVincentX opened this Issue May 18, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@XVincentX

XVincentX commented May 18, 2015

Would be possible to publish this package as npm package as well?

@isteven

This comment has been minimized.

Owner

isteven commented May 18, 2015

Hi @XVincentX ,

I am currently abroad, won't have access to my dev PC for the next few days. Will try to do so when I'm back. Cheers.

@XVincentX

This comment has been minimized.

XVincentX commented May 18, 2015

Graet, looking forward to see the changes.
Please note that introducing your lib as a npm package, you should handle both case (being required by someone and being just loaded as a <script> file)
Have a nice day!

@isteven

This comment has been minimized.

Owner

isteven commented May 19, 2015

Btw I don't have experience working on NPM. Perhaps you can provide some help here?

@XVincentX

This comment has been minimized.

XVincentX commented May 26, 2015

@isteven
Basically the thing would be to simply create a package.json file in your repository using npm init command and filling it appropriately.

Keep in mind that in npm you cannot rely on global objects (such as angular), bur require them ´var angular = require('angular')´.

You can see https://github.com/petejohanson/angular-hy-res as a working example.

@isteven

This comment has been minimized.

Owner

isteven commented May 27, 2015

@XVincentX

This comment has been minimized.

XVincentX commented May 27, 2015

@isteven Basically yes.
The only thing that here would not work is that your javascript file is relying on global angular object, which is not available at all. var angular = require('angular')

@XVincentX XVincentX closed this Aug 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment