I would like to use the CommonJS module system in a clientside javascript application. I chose nodejs as implementation but can\'t find any tutorial or docs on how to use no
SubStack on github has a module called node-browserify.
It will compress and bundle your modules and deliver it as a single js file, but you use it just like Node.js (example from module readme):
foo =
From the module description:
Browserify
Browser-side require() for your node modules and npm packages**
Browserify bundles everything ahead-of-time at the mount point you specify. None of this ajaxy module loading business.
More features:
- recursively bundle dependencies of npm modules
- uses es5-shim for browsers that suck
- filters for {min,ugl}ification
- coffee script works too!