regg

0.0.2 • Public • Published

regg - Registry Pattern for JavaScript

regg helps keep your system decoupled by providing a central location where your application information can be found by other parts of your application.

Installation

 npm install regg

Usage

Register your functions, objects, string etc using register(). Once registered with the service locator there is no way to change it.

var regg = require('regg')()
var foo = 'bar'
regg.register('foobar', foo)
 
console.log(regg.get('foobar')) // bar
 
regg.register('logger', console.bind(console))
 
regg.logger.get('logger').info('Hello world') // Hello world

Credits

Paul Serby follow me on twitter @serby

Licence

Licenced under the New BSD License

/regg/

    Package Sidebar

    Install

    npm i regg

    Weekly Downloads

    52

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • microadam
    • serby
    • jack828