-
-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Max Beatty
committed
Oct 25, 2018
1 parent
78546c1
commit 77c1b2a
Showing
8 changed files
with
260 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ untyped-import | |
untyped-type-import | ||
|
||
[version] | ||
^0.82.0 | ||
^0.84.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.nyc_output/ | ||
flow-typed/ | ||
tests/ | ||
.editorconfig | ||
.flowconfig | ||
.npmignore | ||
.travis.yml | ||
appveyor.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/// <reference types="node" /> | ||
|
||
export interface DotenvParseOptions { | ||
/** | ||
* You may turn on logging to help debug why certain keys or values are not being set as you expect. | ||
*/ | ||
debug?: boolean; | ||
} | ||
|
||
export interface DotenvParseOutput { | ||
[name: string]: string; | ||
} | ||
|
||
/** | ||
* Parses a string or buffer in the .env file format into an object. | ||
* | ||
* @param src - contents to be parsed | ||
* @param options - additional options | ||
* @returns an object with keys and values based on `src` | ||
*/ | ||
export function parse( | ||
src: string | Buffer, | ||
options?: DotenvParseOptions | ||
): DotenvParseOutput; | ||
|
||
export interface DotenvConfigOptions { | ||
/** | ||
* You may specify a custom path if your file containing environment variables is located elsewhere. | ||
*/ | ||
path?: string; | ||
|
||
/** | ||
* You may specify the encoding of your file containing environment variables. | ||
*/ | ||
encoding?: string; | ||
|
||
/** | ||
* You may turn on logging to help debug why certain keys or values are not being set as you expect. | ||
*/ | ||
debug?: boolean; | ||
} | ||
|
||
export interface DotenvConfigOutput { | ||
error?: Error; | ||
parsed?: DotenvParseOutput; | ||
} | ||
|
||
/** | ||
* Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}. | ||
* Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } | ||
* | ||
* @param options - controls behavior | ||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred | ||
* | ||
*/ | ||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput; | ||
export const load: typeof config; |
Oops, something went wrong.