1.1.0 • Published 5 years ago

@demimonde/dotenv v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

@demimonde/dotenv

npm version

@demimonde/dotenv will Read Environment Variables From The .env File Into process.env.

yarn add -E @demimonde/dotenv

Table Of Contents

API

The package is available by importing its default function:

import dotenv from '@demimonde/dotenv'

dotenv(  config: Config,): void

Call this function to get the result you want.

Config: Options for the program.

NameTypeDescriptionDefault
silentbooleanDo not print the names of read env variables.false
locationstringThe location where to look up the .env file.~
namestringThe name of the .env file..env

With the following .env file:

AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=storage1234;AccountKey=hjaskd12t73DGHJs/duiSDue7687dgqbmn2BDS==;EndpointSuffix=core.windows.net
STORAGE=storage1234
CONTAINER=my-new-package
SECRET=facebook-secret

The next example will add 4 env variables.

/* yarn example/ */
import dotenv from '@demimonde/dotenv'

dotenv()
[+] AZURE_STORAGE_CONNECTION_STRING [+] STORAGE [+] CONTAINER [+] SECRET

Copyright

(c) Demimonde 2018