4 ms·
I wasn't really intending to turn it into an npm package as I wrote it for browsers due to its use of MutationObserver.
by Akkuma 12y ago
I wasn't really intending to turn it into an npm package as I wrote it for browsers due to its use of MutationObserver.
- lobster_johnson 12y agonpm is very much used for browser libraries these days: http://browserify.org/ http://browserify.org/.
- Akkuma 12y agoI've never used browserify, despite working in node, so I could be off base but I thought you didn't need to make it an npm package to support CommonJS and play nicely with the rest of your browserify js.
- lobster_johnson 12y agoYou don't need a package.json to use CommonJS or even to use Browserify, but as a developer I don't want to copy external dependencies into a vendor folder to use them, I want to declare my deps in my app's package.json -- so any lib that uses CommonJS but doesn't provide a package.json I will probably not bother to use. People who use npm packages in browser code are pretty much all using Browserify or Webpack and leverage npm. (Many people use Bower, but I don't see the point of using two overlapping package managers.) It's a new dawn of modular JS code; no more global namespace, no more stuffing CDN links in your <head>. I recommend giving it a go.