1.0.15 • Published 6 months ago

@restorecommerce/service-config v1.0.15

Weekly downloads
237
License
MIT
Repository
github
Last release
6 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.15

6 months ago

1.0.14

6 months ago

1.0.13

7 months ago

1.0.12

10 months ago

1.0.11

11 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.10

1 year ago

1.0.5

2 years ago

1.0.4

2 years 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

3 years ago

0.4.27

3 years ago

0.4.24

3 years ago

0.4.25

3 years ago

0.4.21

3 years ago

0.4.22

3 years ago

0.4.23

3 years ago

0.4.19

3 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

4 years ago

0.4.4

4 years ago

0.4.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.6

5 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

7 years ago

0.1.0

7 years ago