An extension containing core services.
// registers extension
kernel.register(require('nomade-core'));
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.
-
translator
: Translates string-
trans(message, [locale], [params])
: returns astring
-
choose(message, count, [locale], [params])
: returns astring
-