The basic usage is:
Another issue that isn't touched on by the 2ality.com post is other API differences. There's a slew of core modules and add-on modules for Node that don't exist in a browser environment. It means that to directly use "any" Node.js module in the browser means implementing some kind of compatibility layer of the core Node.js modules. Otherwise for Node.js modules means limiting those modules to an API set which can be supported in the browser.
- Adapt Node.js modules by wrapping code around them:
- Compile Node.js code (at the command line or on-demand via a server)