UNPKG

wj-config

Version:

Javascript configuration module for NodeJS and browser frameworks such as React that works like ASP.net configuration where data sources are specified (usually JSON files) and environment variables can contribute/overwrite values by following a naming con

11 lines (10 loc) 409 B
import { DictionaryDataSource } from "./DictionaryDataSource.js"; export class EnvironmentDataSource extends DictionaryDataSource { constructor(env, prefix) { super(env, '__', prefix); if (!prefix) { throw new Error('The prefix is mandatory to avoid accidental imports of sensitive data from environment variable values.'); } this.name = 'Environment'; } }