Defur
Version: 0.2.0
Master build:
Develop build:
This library makes it easy to defer the construction or execution of a service until it's needed.
It can be installed in whichever way you prefer, but I recommend NPM.
Basic usage
var defur = ;var http = ; // Just using HTTP as an examplevar services = // Define the service inline... { return ; } ; // ...or define the service laterdefur; // Use the serviceservicesserver; // Service is only created onceservicesserver === servicesserver // true
Contributing
I accept contributions to the source via Pull Request, but passing unit tests must be included before it will be considered for merge.
$ make install$ make tests
If you have Vagrant installed, you can build the dev environment to assist development.
The repository will be mounted in /srv
.
$ vagrant up$ vagrant ssh Welcome to Ubuntu 12.04 LTS $ cd /srv
License
The content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license at http://www.opensource.org/licenses/mit or in LICENSE