UNPKG

876 BTypeScriptView Raw
1/**
2 * Exposes the API to run mutations on `.env` file. The same variables
3 * will be added to `.env.example` with empty contents.
4 */
5export declare class EnvFile {
6 private basePath;
7 private envContents;
8 private exampleEnvContents;
9 constructor(basePath: string);
10 /**
11 * Set key/value pair inside the `.env` file
12 */
13 set(key: string, value: any): this;
14 /**
15 * Returns a key/value pair of the file contents.
16 */
17 get(): {
18 [key: string]: string;
19 };
20 /**
21 * Returns a boolean telling if the file exists.
22 */
23 exists(): boolean;
24 /**
25 * Unset a key/value pair from the `.env` and `.env.example` file
26 */
27 unset(key: string): this;
28 /**
29 * Commit mutations
30 */
31 commit(): void;
32 /**
33 * Rollback mutations
34 */
35 rollback(): void;
36}