Grammin
Grammin

Reputation: 12205

How do I expose my javascript library for other clients to use?

I'm using Vert.x and Angular and I have a javascript library that I would like to allow other people to leverage in their code client-side code. How can I enable them to do something like:

<script src="cdn.myServer/myLib.js"></script>

Basically I want to do the same as google does with ajax.googleapis.com for my js library on my server.

Upvotes: 0

Views: 211

Answers (2)

Bruno Jo&#227;o
Bruno Jo&#227;o

Reputation: 5545

You can use BOWER or NPM to publish your library. So others can include it in their apps by bowr/npm install. Another way is putting it in github and serve it as static file with rawgit.com.

Upvotes: 1

Adrian Rutkowski
Adrian Rutkowski

Reputation: 309

Aside from CDN, you can also make npm or bower package which can be found by other developers in modules repository.

Upvotes: 1

Related Questions