2.0.0 • Published 3 months ago

frontend-config-scope v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

frontend-config-scope

NPM Version Build Status Coverage Status

Config management for the frontend

Basic example

import { ConfigScope } from 'frontend-config-scope'

const envVars = {
  ...import.meta.env,
}

const config = new ConfigScope(envVars)

export const SOME_API_URL = config.getMandatory('API_URL') // this will throw an error if not set
export const BUGSNAG_API_KEY = config.getOptional('VITE_BUGSNAG_API_KEY', '') // this will use default value if not set
export const ENV = config.getMandatoryOneOf('VITE_ENV', ['local', 'development', 'production']) // this will throw an error if not one of the supported values
2.0.0-RC1

3 months ago

2.0.0

3 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago