app-registry

A registry tool to set and share application services

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
app-registry
1.0.17 years ago7 years agoMinified + gzip package size for app-registry in KB

Readme

App Registry
A registry tool to set and share application services.
var registry = require('app-registry');
function serviceOne() {
  console.log('This is the service one');
}

registry.register('firstService', serviceOne);


// Somewere in the app (in another file)
var theServiceINeed = registry.get('firstService');
theServiceINeed();
API

getRegistered()

Return the list of registered services.

register(serviceName, service)

Register a new service.

get(serviceName)

Get the service with name serviceName.
Throw an exception if the service doesn't exists.

exists(serviceName)

Check if the the service with name serviceName exists

unset(serviceName)

Unset if the the service with name serviceName from the registry.

reset()

Remove all services from registry. Useful in the test environment.