This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
config-man
/
2.0.7
config-man 2.0.7
Install from the command line:
Learn more about npm packages
$ npm install @pleo-io/config-man@2.0.7
Install via package.json:
"@pleo-io/config-man": "2.0.7"
About this version
yarn add @pleo-io/config-man
Add [ProjectRoot]/config-man.json
file
{
"schema": [{"key": "server.port", "type": "number", "default": 8080, "nullable": false}]
}
import * as configMan from '@pleo-io/config-man'
configMan.init({
cwd: __dirname,
removeUnknown: true,
configs: [
{type: configMan.ConfigType.DEFAULT},
{type: configMan.ConfigType.DYNAMODB, tableName: 'Configuration-Table', region: 'eu-west-1'},
{type: configMan.ConfigType.JAVASCRIPT, filepath: path.resolve('config.js')},
{type: configMan.ConfigType.JSON, filepath: path.resolve('config.json')},
{type: configMan.ConfigType.ARG, prefix: 'CM_'},
{type: configMan.ConfigType.ENV, prefix: 'CM_},
]
});
async function startApp() {
// Wait for config to be ready
await configMan.ready;
const port = configMan.get('server.port');
// etc...
}
Details
- config-man
- pleo-io
- about 1 year ago
- MIT
- 21 dependencies
Assets
- config-man-2.0.7.tgz
Download activity
- Total downloads 41,005
- Last 30 days 5,472
- Last week 1,357
- Today 0