deno.land / x / simple_utility@v0.0.9 / src / platform.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
import {dirname, fromFileUrl} from "../deps.ts";
/*** Check if it's running on Windows.* @return `true` if running on Windows.*/export function isWin(){ return Deno.build.os === "windows";}
/*** Returns the system wide temporary directory path for each platform.* @return `"C:/Windows/Temp"` if running on Windows, or `"/tmp"` if running on Linux or Mac.*/export function tmpPath(){ switch(Deno.build.os){ case "windows": return "C:/Windows/Temp"; case "linux": return "/tmp"; case "darwin": return "/tmp"; default: throw new Error(); }}
/*** Move current directory to `Deno.mainModule`.*/export function cwdMain(){ Deno.chdir(fromFileUrl(dirname(Deno.mainModule)));}
simple_utility

Version Info

Tagged at
a year ago