1.0.12 • Published 2 months ago

@restorecommerce/service-config v1.0.12

Weekly downloads
237
License
MIT
Repository
github
Last release
2 months ago

@restorecommerce/service-config

An opinionated wrapper of nconf.

Configuration settings are obtain from the following sources in the given order:

  1. Command argument
  2. Environment variables
  3. Configuration files

1.) and 2.) support passing nested object properties with the following pattern:

# Original Configuration JSON file
{
  "someObject": {
    "paramA": "A"
  }
}

Can be overridden via env var or command line parameter someObject__paramA. So the nesting is designated by a double underscore.

3.) tries to load the following configuration files from the cfg folder:

  • Default configuration file config.json
  • Additional sub-variants added to the value of the environment variable NODE_ENV for example a value development:development would try to load config_development.json

Usage

import { createServiceConfig } from '@restorecommerce/service-config';

...

const cfg = createServiceConfig('./test', { stageVar: 'NODE_ENV', logger: logger});
const testSetting = cfg.get('test');
1.0.12

2 months ago

1.0.11

4 months ago

1.0.9

6 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

10 months ago

1.0.10

5 months ago

1.0.5

11 months ago

1.0.4

12 months ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.4.28

2 years ago

0.4.26

2 years ago

0.4.27

2 years ago

0.4.24

2 years ago

0.4.25

2 years ago

0.4.21

2 years ago

0.4.22

2 years ago

0.4.23

2 years ago

0.4.19

2 years ago

0.4.18

3 years ago

0.4.17

3 years ago

0.4.15

3 years ago

0.4.14

3 years ago

0.4.12

3 years ago

0.4.10

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.6

4 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

7 years ago