@configu/node v0.24.0
@configu/node
Configu SDK for Node.js published to npm.
Install
npm install @configu/node
yarn add @configu/node
pnpm add @configu/node
Usage
With import / require:
import {
JsonFileConfigStore,
ConfigSet,
ConfigSchema,
UpsertCommand,
EvalCommand,
ExportCommand,
} from '@configu/node';
import schemaContents from './get-started.cfgu.json';
(async () => {
try {
const store = new JsonFileConfigStore({ path: 'config-db.json' });
const set = new ConfigSet('test');
const schema = new ConfigSchema('get-started', schemaContents);
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({
pipe: data,
}).run();
} catch (error) {
console.error(error);
}
})();
With fs & path:
import path from 'path';
import fs from 'fs/promises';
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 schemaContentsString = await fs.readFile(path.join(__dirname, 'get-started.cfgu.json'));
const schemaContents = JSON.parse(schemaContentsString);
const schema = new ConfigSchema('get-started', schemaContents);
...
} catch (error) {
console.error(error);
}
})();
Reference
Contributing
Requirements
Follow the Development section from the CONTRIBUTING.md
.
Setup
Run these commands in order:
cd ts
npm install
Contribute
Follow the Sending a Pull Request section from the CONTRIBUTING.md
.
18 days ago
17 days ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
6 months ago
8 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
9 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago