deno.land / x / packup@v0.1.12 / install_util.ts

install_util.ts
View Documentation
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
import { join, NAME } from "./deps.ts";
function homedir(os: typeof Deno.build.os): string { if (os === "windows") { return Deno.env.get("USERPROFILE")!; } return Deno.env.get("HOME")!;}
export function wasmCacheDir( os = Deno.build.os, getHomeDir = homedir, maybeDenoDir = Deno.env.get("DENO_DIR"),): string { return maybeDenoDir ? join(maybeDenoDir, NAME) : join(getHomeDir(os), ".deno", NAME);}
export function wasmPath(): string { return join(wasmCacheDir(), "esbuild-0.12.8.wasm");}
export async function installWasm() { const wasmUrl = `https://deno.land/x/esbuild_loader@v0.12.8/vendor/esbuild.wasm`;
console.log(`Downloading esbuild wasm from ${wasmUrl}`);
const res = await fetch(wasmUrl); const bytes = new Uint8Array(await res.arrayBuffer()); const size = (bytes.byteLength / 1024 / 1024).toFixed(2); await Deno.writeFile(wasmPath(), bytes); console.log(`Saved esbuild wasm (${size}MB) at the path ${wasmPath()}`);}
packup
📦 Zero-config web application packager in Deno
GitHub Repositorykt3k/packup
GitHub Stars
260

Version Info

Tagged at
4 months ago