Then, it hit me:
liberator = require('liberator'); liberator.include(['mootools-object', 'mootools-array', 'underscore']);
npm install liberator
But wait -- there's more
Like the idea of using
liberator = require('liberator'); liberator.require(['mootools-core', 'underscore'])
Now you can call something like
var _ = require('underscore');
Ain't that nice?
If you happen to develop on it
cake and see your options.
- Using liberator.require requires you to list all required dependencies, including dependencies in your dependencies, and so on.
- Using liberator.require, some node modules like to call relative path modules such as
require("./lib/libstuff")... liberator isn't smart enough to work with this yet.
- Honestly though, using NPM as your web library dependency manager can get pretty nifty.