I need to use this library banking.js which uses modules. I have downloaded RequireJS and I have been reading for hours, but I can't seem to find any tutorial that uses simply require('Module') like how it is suggested on the github page, they all use different kind of methods that pass anonymous functions (they didn't work for me either). I constantly get the following error:
Uncaught Error: Module name "banking" has not been loaded yet for context: _. Use require([])
I followed the documentation but nothing is working.
NodeJS projects use the CommonJS (CJS) format for modules; RequireJS is mostly used for AMD modules with a few hacks to try to make the two interoperable.
You may want to look into Browserify; it will bundle CJS modules into a browser-includeable JS file, and provides some replacements for NodeJS core modules.