|
| 1 | +declare module "os" { |
| 2 | + /** |
| 3 | + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it |
| 4 | + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. |
| 5 | + * |
| 6 | + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information |
| 7 | + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. |
| 8 | + */ |
| 9 | + export function type(): string; |
| 10 | + |
| 11 | + /** |
| 12 | + * Returns the operating system release as a string. |
| 13 | + * |
| 14 | + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used. See |
| 15 | + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. |
| 16 | + */ |
| 17 | + export function release(): string; |
| 18 | + |
| 19 | + /** |
| 20 | + * Returns a string identifying the kernel version. |
| 21 | + * |
| 22 | + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used. |
| 23 | + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. |
| 24 | + */ |
| 25 | + export function version(): string; |
| 26 | + |
| 27 | + /** |
| 28 | + * Returns the string path of the current user's home directory. |
| 29 | + * |
| 30 | + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it |
| 31 | + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. |
| 32 | + * |
| 33 | + * On Windows, it uses the `USERPROFILE` environment variable if defined. |
| 34 | + * Otherwise it uses the path to the profile directory of the current user. |
| 35 | + */ |
| 36 | + export function homedir(): string; |
| 37 | + |
| 38 | + /** |
| 39 | + * Returns a string identifying the operating system platform for which |
| 40 | + * the Node.js binary was compiled. The value is set at compile time. |
| 41 | + */ |
| 42 | + export function platform(): QuickJS.Platform; |
| 43 | + |
| 44 | + /** |
| 45 | + * Returns the operating system's default directory for temporary files as a |
| 46 | + * string. |
| 47 | + */ |
| 48 | + export function tmpdir(): string; |
| 49 | + |
| 50 | + /** |
| 51 | + * The operating system-specific end-of-line marker. |
| 52 | + * * `\n` on POSIX |
| 53 | + * * `\r\n` on Windows |
| 54 | + */ |
| 55 | + const EOL: string; |
| 56 | + |
| 57 | + /** |
| 58 | + * Returns the operating system CPU architecture for which the LLRT binary was compiled. |
| 59 | + * Possible values are 'arm64', 'x64'. The return value is equivalent to `process.arch`. |
| 60 | + */ |
| 61 | + export function arch(): string; |
| 62 | +} |
0 commit comments