nomade-core

0.1.0 • Public • Published

Nomade core Build Status

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 string
    • trans(message, [locale], [params]): returns a string
    • choose(message, count, [locale], [params]): returns a string

Readme

Keywords

Package Sidebar

Install

npm i nomade-core

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jfsimon