rogain-config

0.3.0 • Public • Published

rogain-config

Use to configure module required by rogain templating tools.

Config

The Config class creates a set of Registry instances for managing the components and filters that are used by Rogain tools.

// create a config 
var config = new Config();
 
// register modules to config registers
config.components.register({
    Button: require('./components/Button.json'),
    Form: require('./components/Form.json')
});
 
config.filters.register('uppercase', require('./filters/uppercase'));

get(type)

Returns a plain object representing the Config instance. Optional type argument can be passed to get a specific config registry.

config.get() // => { components: { }, filters: { } }
config.get('components') // => { Button: { ... }, Form: { ... } }

registerComponent(name, component)

Registers component. Sugar for config.components.register.

unregisterComponent(name)

Unregisters component. Sugar for config.components.unregister.

registerFilter(name, filter)

Registers filter. Sugar for config.filters.register.

unregisterFilter(name)

Unregisters filter. Sugar for config.filters.unregister.

install

npm i rogain-config

Downloadsweekly downloads

2

version

0.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability