nomade-core
v0.1.0
Published
Nomade framework core services
Downloads
3
Readme
Nomade core
An extension containing core services.
Quick start
// registers extension
kernel.register(require('nomade-core'));
Common usage
All services provided by the core extension are based on the adapter pattern.
To always use a specific adapter:
config = { 'service-id': { adapter: 'adapter-id' } };
To route to an adapter using a function:
config = { 'service-id': { adapter: function (/* adapter specific parameters */) { // your logic here return 'adapter-id'; } } };
If you don't specify any adapter, the default one will be used.
If you don't define any config for a service, a special
noop
adapter will be used.If you specify a non existing adapter, the
noop
one will be used.
Provided services
translator
: Translates stringtrans(message, [locale], [params])
: returns astring
choose(message, count, [locale], [params])
: returns astring