[Update August 17, 2011: This post is out of date, see the 0.26.0 release for a better way to use RequireJS with npm.]
[Update July 21, 2011: GitHub users arlolra and JasonGiedymin clued me in to setting up r.js as a bin file that can be installed globally, making it much easier to use. The instructions below have been updated to reflect the changes.]
As asked for on the requirejs list, the RequireJS Node adapter + optimizer is available via npm now:
npm install -g requirejs-r
This will install the r.js file as a global bin/executable that is available for any of your Node projects.
To run main.js via RequireJS in Node:
To optimize a web project using RequireJS, assuming app.build.js contains your optimization profile:
r.js -o app.build.js
"requirejs-r" is a bit of a funny package name, but it comes out of the requirements to use a directory for publishing to NPM, and the r.js name. If it seems useful, I may publish other RequireJS-friendly loader plugins under the "requirejs-" prefix. I may even push require.js to npm, but I am not sure it makes sense yet. If you think it would be useful to you, feel free to leave a comment on this issue.
I'll update the requirejs.org docs if this installation option seems to work out for people.