Just a small module using UMD, that expose both AMD and CommonJS interfaces.
We are using browserify to bundle this very small lib and his dependencies into one bundle.js that expose both AMD and CommonJS. Here is the command we uses for creating the bundle:
browserify src/mylib.js --standalone mylib > src/bundle.js
browser/ directory contains a working example of using the lib in a browser. node/ directory contains a working example of using the lib in NodeJs.
In node/ directory,
node nodeTest.js
in the console, you will see the expected output.
Open browser/index.html in a browser, in the console, you will see the expected output.