2.0.0 • Published 1 year ago

frontend-config-scope v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year 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

1 year ago

2.0.0

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago