kb-config

0.1.0 • Public • Published

#kb-config

Config helper for koa and koa-boot.

##Usage Standalone:

var conf = require('kb-config')({
  path:   __dirname + '/config',
  files:  [['*.js','!local.js'], 'local.js']
});

conf.get('database.connections.mysql.port');

With koa:

var
  app       = require('koa'),
  kbConfig  = require('kb-config');

kbConfig({
  app:    app
  path:   __dirname + '/config',
  files:  [['*.js','!local.js'], 'local.js']
});

app.config('database.connections.mysql.port');

With koa and koa-boot:

var
  app       = require('koa')(),
  koaBoot   = require('koa-boot'),
  kbConfig  = require('kb-config');

koaBoot()
.use(kbConfig.boot({
  path:   __dirname + '/config',
  files:  [['*.js','!local.js'], 'local.js']
}));
.boot(app)
.then(function (app) {
  app.config('database.connections.mysql.port');
});

Readme

Keywords

none

Package Sidebar

Install

npm i kb-config

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • cahnory