UNPKG

1.47 kBTypeScriptView Raw
1// Type definitions for osenv 0.1
2// Project: https://github.com/npm/osenv
3// Definitions by: Adam Zerella <https://github.com/adamzerella>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/**
7 * The machine name. Calls hostname if not found.
8 */
9export function hostname(cb?: (hostname: string, error?: string) => void): string;
10
11/**
12 * The currently logged-in user. Calls whoami if not found.
13 */
14export function user(cb?: (user: string, error?: string) => void): string;
15
16/**
17 * Either PS1 on unix, or PROMPT on Windows.
18 */
19export function prompt(cb?: (prompt: string, error?: string) => void): string;
20
21/**
22 * The place where temporary files should be created.
23 */
24export function tmpdir(cb?: (tmpdir: string, error?: string) => void): string;
25
26/**
27 * No place like it.
28 */
29export function home(cb?: (home: string, error?: string) => void): string;
30
31/**
32 * An array of the places that the operating system will search for executables.
33 */
34export function path(cb?: (path: string, error?: string) => void): string;
35
36/**
37 * Return the executable name of the editor program.
38 * This uses the EDITOR and VISUAL environment variables,
39 * and falls back to vi on Unix, or notepad.exe on Windows.
40 */
41export function editor(cb?: (editor: string, error?: string) => void): string;
42
43/**
44 * The SHELL on Unix, which Windows calls the ComSpec.
45 * Defaults to 'bash' or 'cmd'.
46 */
47export function shell(cb?: (shell: string, error?: string) => void): string;