isteven/angular-omni-bar

npm package

XVincentX opened this issue · 6 comments

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

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.

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!

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

@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 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')