It would be really nice if you can publish the library on some CDN. For example on cdnjs.com.
Anyway, since the lib is already published on NPM then we can use https://unpkg.com/ CDN.
I tried and this worked for me:
Ideally I wanted to include it as https://unpkg.com/rss-parser/ but then it will return index.js file which is for NodeJS. Also there is a lot of included dependencies which may be already included into my page. In their documentation said that library author should prepare some UMD file:
Workflow
For npm package authors, unpkg relieves the burden of publishing your code to a CDN in addition to the npm registry. All you need to do is include your UMD build in your npm package (not your repo, that's different!).
You can do this easily using the following setup:
Add the umd (or dist) directory to your .gitignore file
Add the umd directory to your files array in package.json
Use a build script to generate your UMD build in the umd directory when you publish
That's it! Now when you npm publish you'll have a version available on unpkg as well.
It would be really nice if you can publish the library on some CDN. For example on cdnjs.com. Anyway, since the lib is already published on NPM then we can use https://unpkg.com/ CDN. I tried and this worked for me:
Ideally I wanted to include it as
https://unpkg.com/rss-parser/
but then it will returnindex.js
file which is for NodeJS. Also there is a lot of included dependencies which may be already included into my page. In their documentation said that library author should prepare some UMD file: