Yes Node does. That loader uses the CommonJS module format. The CommonJS module format is non-optimal for the browser, and I do not agree with some of the trade-offs made in the CommonJS module format. By using RequireJS on the server, you can use one format for all your modules, whether they are running server side or in the browser. That way you can preserve the speed benefits and easy debugging you get with RequireJS in the browser, and not have to worry about extra translation costs for moving between two formats.
Yes! The Node adapter for RequireJS, called r.js, will use Node's implementation of require and Node's search paths if the module is not found with the configuration used by RequireJS, so you can continue to use your existing Node-based modules without having to do changes to them.
However, the top most app file, the one you pass to r.js on startup, needs to be coded to the RequireJS API.
RequireJS will use its Configuration Options first to find modules. If RequireJS cannot find the module with its configuration, it is assumed to be a module that uses Node's type of modules and configuration. So, only configure module locations with RequireJS if they use the RequireJS API. For modules that expect Node's APIs and configuration/paths, just install them with a Node package manager, like npm, and do not configure their locations with RequireJS.
Even though RequireJS is an asynchronous loader in the browser, the RequireJS Node adapter loads modules synchronously in the Node environment to match the default loading behavior in Node.
Finally, RequireJS in Node can only load modules that are on the local disk -- fetching modules across http, for instance, is not supported at this time.
Download r.js from the the download page and place it on your disk somewhere. Then run this command:
node path/to/r.js myNodeApp.js
This assumes you are in the directory that contains myNodeApp.js, your top-level Node application file.
That is it!
If you want to try a sample app that works with r.js, see the index.js Hello World app on the download page.
If you find you have a problem, and want to report it, use the RequireJS GitHub Issues page.
If you want to discuss the RequireJS-Node integration, you can use the RequireJS Group.