Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 1.9 KB

File metadata and controls

51 lines (30 loc) · 1.9 KB

dora-plugin-config-manager

NPM version Build Status Coverage Status NPM downloads

dora plugin for config manager。


Usage

$ npm i dora dora-plugin-config-manager -SD
$ ./node_modules/.bin/dora --plugins 'atool-build,config-manager?path=./config.js|exports-exports&watchDelay=300'

Param - path

It is the path to your global *.config.js file. If you do not specify exports would export default, otherwise would export exports which you specify after |.

Multiple exports please the connector - to connect them one by one.

Note: config is the reserved word!

The exports will be seted by Dora.set

So you can use the value in other plugins, just by Dora.get

If the exports named a , then the way to get the configure is this.get('_global_a')

If you dont use exports the default configure is under this.get('_global_config')

Param - watchDelay

Your *.config.js is alive!

If exports which named a e.x. changed during servering. You can receive the event by this.get('configManagerEmitter').on('_global_a', callback).

Or global.configManagerEmitter.on('_global_a', callback)

Test

$ npm test

LICENSE

MIT