Configu SDK for Node.js
To install the this package, simply type add or install @configu/node using your favorite package manager:
npm install @configu/node
yarn add @configu/node
pnpm add @configu/node
import path from 'path';
import {
JsonFileConfigStore,
ConfigSet,
ConfigSchema,
UpsertCommand,
EvalCommand,
ExportCommand,
} from '@configu/node';
(async () => {
try {
const store = new JsonFileConfigStore({ path: 'config-db.json' });
const set = new ConfigSet('test');
const schema = new ConfigSchema(path.join(__dirname, 'get-started.cfgu.json'));
await new UpsertCommand({
store,
set,
schema,
configs: {
'GREETING': 'hey',
'SUBJECT': 'configu node.js sdk'
},
}).run();
const data = await new EvalCommand({
store,
set,
schema,
}).run();
const configurationData = await new ExportCommand({
data,
}).run();
} catch (error) {
console.error(error);
}
})();
- Follow the Development section from the
CONTRIBUTING.md
.
Run these commands in order:
cd ts
npm install
Follow the Sending a Pull Request section from the CONTRIBUTING.md
.