require-ing modules less require-y.
$ npm install --save modmod
Then, change your code from:
var fs = ;var chalk = ;var wiredep = ;fs;
var $ = 'fs' 'chalk' 'wiredep';$fs;
Local vs External Modules
modmod is only intended to be used with external (npm-land) modules, and Node's native modules (
fs, etc.). If you would like to namespace your local modules, you are welcome to assign additional objects on top of the object
modmod returns. As an example:
var $ = 'fs' 'chalk' 'wiredep';$local =helpers:utils:;
It's up to you. There's nothing wrong with the current system of multiple var declarations, and having too many isn't a node problem. Regardless, you may still consider it useful to namespace your dependencies under a name of your choosing, such as
$, freeing up those "global" variables for use without conflicts.
MIT © Stephen Sawchuk