/
index.d.ts
36 lines (28 loc) · 914 Bytes
/
index.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
declare namespace shellEnv {
interface EnvironmentVariables {
readonly [key: string]: string;
}
}
declare const shellEnv: {
/**
Get the environment variables defined in your dotfiles.
@param shell - The shell to read environment variables from. Default: User default shell.
@returns The environment variables.
@example
```
import shellEnv = require('shell-env');
console.log(shellEnv.sync());
//=> {TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', ...}
console.log(shellEnv.sync('/bin/bash'));
//=> {TERM_PROGRAM: 'iTerm.app', SHELL: '/bin/zsh', ...}
```
*/
(shell?: string): Promise<shellEnv.EnvironmentVariables>;
/**
Get the environment variables defined in your dotfiles.
@param shell - The shell to read environment variables from. Default: User default shell.
@returns The environment variables.
*/
sync(shell?: string): shellEnv.EnvironmentVariables;
};
export = shellEnv;