forked from keithmorris/node-dotenv-extended
-
Notifications
You must be signed in to change notification settings - Fork 3
/
dotenv-extended.d.ts
91 lines (79 loc) · 2.18 KB
/
dotenv-extended.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/// <reference types="dotenv" />
/**
* The result of a call to load() or parse()
*/
export interface IEnvironmentMap {
[name: string]: string;
}
/**
* DotenvExtended options for load().
*/
export interface IDotenvExtendedOptions {
/**
* Sets the encoding of the .env files.
*
* @default 'utf-8'
*/
encoding?: string;
/**
* Sets whether a log message is shown when missing the .env or .env.defaults files.
*
* @default true
*/
silent?: boolean;
/**
* Path to the main .env file that contains your variables.
*
* @default '.env'
*/
path?: string;
/**
* The path to the file that default values are loaded from.
*
* @default '.env.defaults'
*/
defaults?: string;
/**
* The path to the file that contains the schema of what values should be available
* from combining .env and .env.defaults.
*
* @default '.env.schema'
*/
schema?: string;
/**
* Causes the library to throw a MISSING CONFIG VALUES error listing all of the variables
* missing the combined .env and .env.defaults files.
*
* @default false
*/
errorOnMissing?: boolean;
/**
* Causes the library to throw a EXTRA CONFIG VALUES error listing all of the extra variables
* from the combined .env and .env.defaults files.
*
* @default false
*/
errorOnExtra?: boolean;
/**
* Sets whether the loaded values are assigned to the process.env object.
* If this is set, you must capture the return value of the call to .load() or you will not be
* able to use your variables.
*
* @default true
*/
assignToProcessEnv?: boolean;
/**
* By defaut, dotenv-entended will not overwrite any varibles that are already set in the process.env object.
* If you would like to enable overwriting any already existing values, set this value to true.
*
* @default false
*/
overrideProcessEnv?: boolean;
}
export { parse } from 'dotenv';
/**
* Loads the dotenv files, .env, .env.defaults and .env.schema.
*
* @param options
*/
export function load(options?: IDotenvExtendedOptions): IEnvironmentMap;