get me
Simplifies requiring packages in node harmony, using proxies and memoisation to load packages only as required.
Install
$ npm install get-me --save
But why
Partly because I wanted to do something fun with Proxies, but also because why would you do this
var fsx = path = globby = execSync = execSync _ = inquirer = ; { var dest = path; inquirerprompt/**/ { _; matches = globby; matches; ; };}
When you can do this
var $ = require execSync: '[child_process].execSync'; { var dest = $path; $inquirerprompt/**/ { $underscore; matches = $globby; matches; $; };}
Need to bring a new library into a file?
No need to scroll back to the top, drop in another require and all that jazz - just start using it, it's a simple as typing $.myNewLibrary.doStuff()
! You can install it later, and if you forget, get-me will tell you about it when it can't find what you were looking for!
See the examples folder for a more replete example of all the API features.
Mocking in tests
You can also now use get-me for providing stubs/mocks in tests by means of global aliases
// app.jsvar $ = require;module { $myDependencya = val;}
// spec.jsvar getme = $ = ; ;