Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 1.7 KB

README.md

File metadata and controls

85 lines (63 loc) · 1.7 KB

@configu/node

Configu SDK for Node.js

Install

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

Usage

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);
  }
})();

Reference

See oss.configu.com/node

Contributing

Requirements

  1. 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.