-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.d.ts
39 lines (29 loc) · 1.06 KB
/
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
37
38
39
export type EnvironmentVariables = Readonly<Record<string, string>>;
/**
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} from 'shell-env';
console.log(await shellEnv());
//=> {TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', ...}
console.log(await shellEnv('/bin/bash'));
//=> {TERM_PROGRAM: 'iTerm.app', SHELL: '/bin/zsh', ...}
```
*/
export function shellEnv(shell?: string): Promise<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.
@example
```
import {shellEnvSync} from 'shell-env';
console.log(shellEnvSync());
//=> {TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', ...}
console.log(shellEnvSync('/bin/bash'));
//=> {TERM_PROGRAM: 'iTerm.app', SHELL: '/bin/zsh', ...}
```
*/
export function shellEnvSync(shell?: string): EnvironmentVariables;