0.24.0 • Published 17 days ago

@configu/node v0.24.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
17 days ago

@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

oss.configu.com/node

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.

0.23.2

18 days ago

0.24.0

17 days ago

0.23.1

2 months ago

0.23.0

2 months ago

0.24.0-next.1

2 months ago

0.23.0-next.6

2 months ago

0.23.0-next.4

2 months ago

0.23.0-next.5

2 months ago

0.23.0-next.3

2 months ago

0.23.0-next.2

2 months ago

0.23.0-next.1

2 months ago

0.22.0

3 months ago

0.21.1

3 months ago

0.21.0

3 months ago

0.20.2-next.5

3 months ago

0.20.2-next.6

3 months ago

0.20.2-next.4

3 months ago

0.20.2-next.3

3 months ago

0.20.2-next.2

3 months ago

0.20.2-next.1

3 months ago

0.20.1

5 months ago

0.20.0

6 months ago

0.19.0

8 months ago

0.18.1

9 months ago

0.14.0

10 months ago

0.15.0

9 months ago

0.14.1

10 months ago

0.16.0

9 months ago

0.17.0

9 months ago

0.18.0

9 months ago

0.11.0

11 months ago

0.12.0

11 months ago

0.11.1

11 months ago

0.13.0

11 months ago

0.10.3

1 year ago

0.10.4

1 year ago

0.10.0-next.31

1 year ago

0.10.0

1 year ago

0.10.0-next.30

1 year ago

0.10.0-next.28

1 year ago

0.10.0-next.27

1 year ago

0.10.0-next.29

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.6

1 year ago

0.9.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.8.3

1 year ago

0.9.1

1 year ago

0.8.2

1 year ago

0.7.0

1 year ago

0.6.3

2 years ago

0.6.2

2 years ago

0.5.3

2 years ago

0.5.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago