@numbereight/config
TypeScript icon, indicating that this package has built-in type declarations

3.2.8 • Public • Published

@numbereight/config

An opinionated config manager.

Use like:

import * as config from '@numbereight/config';

const env = config.get({
  // My convict Schema
  MY_VAR: {
    doc: 'This is the var of mine',
    format: String,
    env: 'MY_VAR',
    sensitive: false,
    // Use config.required to not have a default
    default: config.required as string
  }
});

Indirection

Config supports the following indirections. When a variable's value begins with:

  • b64:, the content of the variable is replaced with the base64-decoded value of the remainder of the variable.
  • b64-file:, the content of the variable is replaced with a filepath to a temporary file that contains the base64-decoded value of the remainder of the variable.
  • filepath:, the content of the variable is replaced with the content of the given filepath.

Readme

Keywords

none

Package Sidebar

Install

npm i @numbereight/config

Weekly Downloads

29

Version

3.2.8

License

none

Unpacked Size

29.9 kB

Total Files

21

Last publish

Collaborators

  • nechris