whatwhywhenandwho-gestalt
TypeScript icon, indicating that this package has built-in type declarations

0.1.12 • Public • Published

gestalt

Environment variables

GESTALT_APPLICATION_PATH=string
GESTALT_ID=string

Configuration

gestalt is going to generate a path and read the configuration from:

GESTALT_APPLICATION_PATH
CONFIGURATIONS_DIRECTORY
GESTALT_ID.json

We can use different GESTALT_ID for different environments - development, staging, production, etc.

Environment variable injection

We can inject environment variables into any configuration via interpolation. For example:

{
	module: {
		setting: '${gestalt.environment.VARIABLE}'
	}
}

Project integration standard

  1. Link whatwhywhenandwho-gestalt.

  2. Create source/package-settings.ts with the following template:

    import { gestalt } from 'whatwhywhenandwho-gestalt';

    import { PACKAGE_NAME } from './definitions/base.definition';

    export interface IGestaltPackageSettings { // Define your settings. }

    export default gestalt.getPackageSettings( PACKAGE_NAME, { // Define your defaults, if any. } );

  3. Export the interface and the settings in main.ts as the last entry, so other packages can use them:

    ... import packageSettings, { IGestaltPackageSettings } from './package-settings';

    export { ..., IGestaltPackageSettings, packageSettings };

  4. Import packageSettings wherever you need them.

Have a nice day 😘

Readme

Keywords

none

Package Sidebar

Install

npm i whatwhywhenandwho-gestalt

Weekly Downloads

4

Version

0.1.12

License

none

Unpacked Size

22.9 kB

Total Files

34

Last publish

Collaborators

  • whatwhywhenandwho