@lifo-sh/core 0.5.0 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/args-BhoL0JcG.js +58 -0
- package/dist/awk-DahiO6Jl.js +170 -0
- package/dist/base64-Dj_AnQAH.js +92 -0
- package/dist/basename-D8sjWfzX.js +14 -0
- package/dist/bc-CCuJi0IY.js +230 -0
- package/dist/browser-B0dadKCA.js +43 -0
- package/dist/cal-DQsLvArw.js +85 -0
- package/dist/cat-KYGveROo.js +32 -0
- package/dist/chmod-gYZdg3Kv.js +81 -0
- package/dist/chown-DoPi7NLO.js +32 -0
- package/dist/commands/net/curl.d.ts +2 -2
- package/dist/commands/net/curl.d.ts.map +1 -1
- package/dist/commands/net/forward.d.ts +14 -0
- package/dist/commands/net/forward.d.ts.map +1 -0
- package/dist/commands/net/host.d.ts +14 -0
- package/dist/commands/net/host.d.ts.map +1 -0
- package/dist/commands/net/ifconfig.d.ts +8 -0
- package/dist/commands/net/ifconfig.d.ts.map +1 -0
- package/dist/commands/net/ip.d.ts +14 -0
- package/dist/commands/net/ip.d.ts.map +1 -0
- package/dist/commands/net/netstat.d.ts +8 -0
- package/dist/commands/net/netstat.d.ts.map +1 -0
- package/dist/commands/net/ports.d.ts +8 -0
- package/dist/commands/net/ports.d.ts.map +1 -0
- package/dist/commands/net/route.d.ts +8 -0
- package/dist/commands/net/route.d.ts.map +1 -0
- package/dist/commands/net/test-registry.d.ts +8 -0
- package/dist/commands/net/test-registry.d.ts.map +1 -0
- package/dist/commands/net/tunnel-v2.d.ts +4 -0
- package/dist/commands/net/tunnel-v2.d.ts.map +1 -0
- package/dist/commands/net/tunnel.d.ts +6 -0
- package/dist/commands/net/tunnel.d.ts.map +1 -0
- package/dist/commands/registry.d.ts +1 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/system/kill.d.ts +2 -2
- package/dist/commands/system/kill.d.ts.map +1 -1
- package/dist/commands/system/lifo.d.ts +19 -2
- package/dist/commands/system/lifo.d.ts.map +1 -1
- package/dist/commands/system/newtab.d.ts +8 -0
- package/dist/commands/system/newtab.d.ts.map +1 -0
- package/dist/commands/system/node.d.ts +3 -2
- package/dist/commands/system/node.d.ts.map +1 -1
- package/dist/commands/system/npm.d.ts +20 -7
- package/dist/commands/system/npm.d.ts.map +1 -1
- package/dist/commands/system/ps.d.ts +3 -2
- package/dist/commands/system/ps.d.ts.map +1 -1
- package/dist/commands/system/systemctl.d.ts +4 -0
- package/dist/commands/system/systemctl.d.ts.map +1 -0
- package/dist/commands/system/top.d.ts +2 -2
- package/dist/commands/system/top.d.ts.map +1 -1
- package/dist/commands/system/watch.d.ts.map +1 -1
- package/dist/commands/system/whoami.d.ts.map +1 -1
- package/dist/commands/types.d.ts +3 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/cp-BP7-nkZi.js +29 -0
- package/dist/cut-Dg3Sxlw_.js +84 -0
- package/dist/date-DqL4oCg8.js +91 -0
- package/dist/df-CEHqyq91.js +47 -0
- package/dist/diff-aYLFp43G.js +250 -0
- package/dist/dig-0_V5UoWW.js +91 -0
- package/dist/dirname-ByojkmnI.js +14 -0
- package/dist/du-feoEC53Q.js +89 -0
- package/dist/env-CIcDulqw.js +10 -0
- package/dist/fastfetch-CRfsfb4t.js +378 -0
- package/dist/file-BHHCgjt9.js +79 -0
- package/dist/find-C-pGJyTZ.js +63 -0
- package/dist/free-DCkGta9v.js +33 -0
- package/dist/grep-Bv7fu1qw.js +179 -0
- package/dist/gunzip-BZk2000a.js +57 -0
- package/dist/gzip-D55LwDu8.js +70 -0
- package/dist/head-CQQ8pAha.js +66 -0
- package/dist/hostname-Ba0tnCzG.js +8 -0
- package/dist/index-GLjTMF7C.js +22717 -0
- package/dist/index.d.ts +44 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -72
- package/dist/less-C-8XcQ_A.js +294 -0
- package/dist/ln-CpXREm6e.js +15 -0
- package/dist/ls-Ce1mcASB.js +132 -0
- package/dist/{man-Dg26tZ-a.js → man-DjxHeM01.js} +46 -27
- package/dist/mime-B5knsVEw.js +101 -0
- package/dist/mkdir-CtDdaiaM.js +31 -0
- package/dist/mktemp-DwAY8Lz2.js +44 -0
- package/dist/mv-vS020rcy.js +29 -0
- package/dist/nano-DKfqXthq.js +445 -0
- package/dist/nl-DHh-MmKX.js +66 -0
- package/dist/ping-BQO3Z9CT.js +72 -0
- package/dist/pkg/PackageManager.d.ts +2 -2
- package/dist/pkg/PackageManager.d.ts.map +1 -1
- package/dist/pkg/lifo-dev.d.ts +6 -6
- package/dist/pkg/lifo-dev.d.ts.map +1 -1
- package/dist/pkg/lifo-runtime.d.ts +3 -3
- package/dist/pkg/lifo-runtime.d.ts.map +1 -1
- package/dist/pkg/loader.d.ts +2 -2
- package/dist/pkg/loader.d.ts.map +1 -1
- package/dist/printf-CdBVx2dT.js +81 -0
- package/dist/realpath-CZ_ja3FL.js +27 -0
- package/dist/rev-KZ9O5vNS.js +42 -0
- package/dist/rm-dW7YB25j.js +48 -0
- package/dist/rmdir-Db2wctQ6.js +42 -0
- package/dist/runtime/ContextSerialization.d.ts +7 -0
- package/dist/runtime/ContextSerialization.d.ts.map +1 -0
- package/dist/runtime/ProcessExecutor.d.ts +14 -0
- package/dist/runtime/ProcessExecutor.d.ts.map +1 -0
- package/dist/runtime/command-worker.d.ts +9 -0
- package/dist/runtime/command-worker.d.ts.map +1 -0
- package/dist/sandbox/Sandbox.d.ts +1 -2
- package/dist/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/sandbox/SandboxFs.d.ts +2 -2
- package/dist/sandbox/SandboxFs.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts +1 -2
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sed-BK_pjM2M.js +142 -0
- package/dist/seq-B0yurkx9.js +64 -0
- package/dist/sha256sum-BP0l9D35.js +85 -0
- package/dist/shell/ProcessRegistry.d.ts +152 -0
- package/dist/shell/ProcessRegistry.d.ts.map +1 -0
- package/dist/shell/ProcessRegistry.example.d.ts +8 -0
- package/dist/shell/ProcessRegistry.example.d.ts.map +1 -0
- package/dist/shell/ProcessRegistry.test.d.ts +2 -0
- package/dist/shell/ProcessRegistry.test.d.ts.map +1 -0
- package/dist/shell/Shell.d.ts +13 -4
- package/dist/shell/Shell.d.ts.map +1 -1
- package/dist/shell/completer.d.ts +2 -2
- package/dist/shell/completer.d.ts.map +1 -1
- package/dist/shell/expander.d.ts +2 -2
- package/dist/shell/expander.d.ts.map +1 -1
- package/dist/shell/history.d.ts +2 -2
- package/dist/shell/history.d.ts.map +1 -1
- package/dist/shell/interpreter.d.ts +8 -2
- package/dist/shell/interpreter.d.ts.map +1 -1
- package/dist/shell/test-builtin.d.ts +2 -2
- package/dist/shell/test-builtin.d.ts.map +1 -1
- package/dist/sl-BmMNz7ir.js +200 -0
- package/dist/sleep-C_3mjcFi.js +25 -0
- package/dist/sort-DYZuiMaO.js +87 -0
- package/dist/stat-CXSSmsrA.js +38 -0
- package/dist/strings-BwqQy-zL.js +63 -0
- package/dist/tac-CuZSbu_c.js +32 -0
- package/dist/tail-DH7xR0rW.js +62 -0
- package/dist/tar-AnR03GXP.js +155 -0
- package/dist/tee-ByHsMExU.js +29 -0
- package/dist/touch-CcmnMpg5.js +26 -0
- package/dist/tr-D_cg13q8.js +92 -0
- package/dist/tree-Ck1ymlSv.js +64 -0
- package/dist/uname-07bQ7DTD.js +50 -0
- package/dist/uniq-BHkwpex3.js +76 -0
- package/dist/unzip-DVjk3GA4.js +91 -0
- package/dist/uptime-ujk4Nb77.js +17 -0
- package/dist/utils/archive.d.ts +2 -2
- package/dist/utils/archive.d.ts.map +1 -1
- package/dist/utils/glob.d.ts +2 -2
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/wc-CK9Flybx.js +98 -0
- package/dist/wget-Cww1uNE2.js +84 -0
- package/dist/{which-D3u0cwyh.js → which-CJwCjtVK.js} +25 -14
- package/dist/whoami-EHyrQ1q-.js +25 -0
- package/dist/xargs-I1ZWqhOp.js +40 -0
- package/dist/yes-XolnW6bp.js +11 -0
- package/dist/zip-BTmRwUYQ.js +40 -0
- package/package.json +16 -10
- package/dist/args-CG6b9cZt.js +0 -43
- package/dist/awk-CC_Qo0hQ.js +0 -123
- package/dist/base64-BBckAmkE.js +0 -72
- package/dist/basename-BIICW06y.js +0 -12
- package/dist/bc-BYiKVTNg.js +0 -200
- package/dist/cal-DPULSAhj.js +0 -56
- package/dist/cat-Jv35D4BV.js +0 -29
- package/dist/chmod-Bh-u8XOr.js +0 -56
- package/dist/chown-Dv7xfl2a.js +0 -28
- package/dist/cp-CB-sGTRH.js +0 -19
- package/dist/cut-B79kgCm4.js +0 -65
- package/dist/date-C8NB8v8G.js +0 -86
- package/dist/df-CeZb4WOr.js +0 -34
- package/dist/diff-D5Ej-JEe.js +0 -150
- package/dist/dig-BEJ8Ky96.js +0 -69
- package/dist/dirname-w2Y6csox.js +0 -13
- package/dist/du-UupzdKc_.js +0 -77
- package/dist/env-DXzvDKsN.js +0 -9
- package/dist/fastfetch-aPM9Z3ym.js +0 -310
- package/dist/file-DOl4Wjtc.js +0 -70
- package/dist/find-C0T-P7sl.js +0 -36
- package/dist/free-DAxE4b2U.js +0 -23
- package/dist/grep-Blwrv9k5.js +0 -147
- package/dist/gunzip-R7EtgP15.js +0 -47
- package/dist/gzip-BxF7M1np.js +0 -57
- package/dist/head-CJwcsX18.js +0 -53
- package/dist/hostname-BxU2S3nT.js +0 -8
- package/dist/index-BjKSFBDg.js +0 -8640
- package/dist/kernel/index.d.ts +0 -26
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/persistence/PersistenceManager.d.ts +0 -12
- package/dist/kernel/persistence/PersistenceManager.d.ts.map +0 -1
- package/dist/kernel/persistence/backends.d.ts +0 -22
- package/dist/kernel/persistence/backends.d.ts.map +0 -1
- package/dist/kernel/persistence/index.d.ts +0 -6
- package/dist/kernel/persistence/index.d.ts.map +0 -1
- package/dist/kernel/persistence/serializer.d.ts +0 -21
- package/dist/kernel/persistence/serializer.d.ts.map +0 -1
- package/dist/kernel/samples.d.ts +0 -3
- package/dist/kernel/samples.d.ts.map +0 -1
- package/dist/kernel/storage/BlobStore.d.ts +0 -31
- package/dist/kernel/storage/BlobStore.d.ts.map +0 -1
- package/dist/kernel/storage/ContentStore.d.ts +0 -52
- package/dist/kernel/storage/ContentStore.d.ts.map +0 -1
- package/dist/kernel/storage/index.d.ts +0 -7
- package/dist/kernel/storage/index.d.ts.map +0 -1
- package/dist/kernel/vfs/VFS.d.ts +0 -64
- package/dist/kernel/vfs/VFS.d.ts.map +0 -1
- package/dist/kernel/vfs/index.d.ts +0 -7
- package/dist/kernel/vfs/index.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/DevProvider.d.ts +0 -11
- package/dist/kernel/vfs/providers/DevProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts +0 -63
- package/dist/kernel/vfs/providers/NativeFsProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/providers/ProcProvider.d.ts +0 -14
- package/dist/kernel/vfs/providers/ProcProvider.d.ts.map +0 -1
- package/dist/kernel/vfs/types.d.ts +0 -70
- package/dist/kernel/vfs/types.d.ts.map +0 -1
- package/dist/less-B0gFLJ_7.js +0 -230
- package/dist/ln-Bf3f3jVA.js +0 -11
- package/dist/ls-YnhMRefh.js +0 -106
- package/dist/mkdir-DY1P3Jxj.js +0 -27
- package/dist/mktemp-BRzo2c8y.js +0 -31
- package/dist/mv-bH08L-F_.js +0 -19
- package/dist/nano-CueO2oS0.js +0 -304
- package/dist/nl-D26SSOD4.js +0 -51
- package/dist/node-compat/buffer.d.ts +0 -44
- package/dist/node-compat/buffer.d.ts.map +0 -1
- package/dist/node-compat/child_process.d.ts +0 -10
- package/dist/node-compat/child_process.d.ts.map +0 -1
- package/dist/node-compat/console.d.ts +0 -21
- package/dist/node-compat/console.d.ts.map +0 -1
- package/dist/node-compat/crypto.d.ts +0 -17
- package/dist/node-compat/crypto.d.ts.map +0 -1
- package/dist/node-compat/events.d.ts +0 -19
- package/dist/node-compat/events.d.ts.map +0 -1
- package/dist/node-compat/fs.d.ts +0 -175
- package/dist/node-compat/fs.d.ts.map +0 -1
- package/dist/node-compat/http.d.ts +0 -87
- package/dist/node-compat/http.d.ts.map +0 -1
- package/dist/node-compat/index.d.ts +0 -19
- package/dist/node-compat/index.d.ts.map +0 -1
- package/dist/node-compat/os.d.ts +0 -39
- package/dist/node-compat/os.d.ts.map +0 -1
- package/dist/node-compat/path.d.ts +0 -58
- package/dist/node-compat/path.d.ts.map +0 -1
- package/dist/node-compat/process.d.ts +0 -62
- package/dist/node-compat/process.d.ts.map +0 -1
- package/dist/node-compat/stream.d.ts +0 -36
- package/dist/node-compat/stream.d.ts.map +0 -1
- package/dist/node-compat/string_decoder.d.ts +0 -11
- package/dist/node-compat/string_decoder.d.ts.map +0 -1
- package/dist/node-compat/timers.d.ts +0 -16
- package/dist/node-compat/timers.d.ts.map +0 -1
- package/dist/node-compat/url.d.ts +0 -53
- package/dist/node-compat/url.d.ts.map +0 -1
- package/dist/node-compat/util.d.ts +0 -27
- package/dist/node-compat/util.d.ts.map +0 -1
- package/dist/node-compat/zlib.d.ts +0 -66
- package/dist/node-compat/zlib.d.ts.map +0 -1
- package/dist/ping-DtVEwwda.js +0 -50
- package/dist/printf-Cc2o7KZx.js +0 -70
- package/dist/realpath-BH29Lem_.js +0 -24
- package/dist/rev-ySwmRf_K.js +0 -39
- package/dist/rm-D7iWUUE2.js +0 -37
- package/dist/rmdir-BLtdNjt1.js +0 -35
- package/dist/sed-DwBPYYFb.js +0 -95
- package/dist/seq-B01YKIbO.js +0 -37
- package/dist/sha256sum-DED6ePiU.js +0 -64
- package/dist/sl-Dv4iPBN6.js +0 -138
- package/dist/sleep-B4C3fZiR.js +0 -19
- package/dist/sort-OXqZY83v.js +0 -64
- package/dist/stat-BvwNpE5B.js +0 -29
- package/dist/strings-BesRwUt_.js +0 -42
- package/dist/tac-D4BMSdj9.js +0 -31
- package/dist/tail-xVmLkzJK.js +0 -52
- package/dist/tar-BHRJ0-4j.js +0 -120
- package/dist/tee-DxygINEJ.js +0 -17
- package/dist/touch-DCb9Qn5q.js +0 -23
- package/dist/tr-DsCiwSIu.js +0 -60
- package/dist/tree-4QpgsnA0.js +0 -46
- package/dist/uname-BCn8HlJD.js +0 -37
- package/dist/uniq-xmgE0zRj.js +0 -54
- package/dist/unzip-CDKcoB0B.js +0 -81
- package/dist/uptime-CgBJegqU.js +0 -8
- package/dist/wc-B-jNRfLa.js +0 -69
- package/dist/wget-CO-45JoL.js +0 -53
- package/dist/whoami-Y18wqme3.js +0 -25
- package/dist/xargs-DfbCRFFd.js +0 -35
- package/dist/yes-DXEyHHD2.js +0 -10
- package/dist/zip-Cu1DzbAu.js +0 -33
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
const ESC = "\x1B[";
|
|
2
|
+
const RST = `${ESC}0m`;
|
|
3
|
+
const BOLD = `${ESC}1m`;
|
|
4
|
+
function fg(code) {
|
|
5
|
+
return `${ESC}38;5;${code}m`;
|
|
6
|
+
}
|
|
7
|
+
function bg(code) {
|
|
8
|
+
return `${ESC}48;5;${code}m`;
|
|
9
|
+
}
|
|
10
|
+
function rgb(r, g, b) {
|
|
11
|
+
return `${ESC}38;2;${r};${g};${b}m`;
|
|
12
|
+
}
|
|
13
|
+
const COLOR_MAP = {
|
|
14
|
+
black: fg(0),
|
|
15
|
+
red: fg(1),
|
|
16
|
+
green: fg(2),
|
|
17
|
+
yellow: fg(3),
|
|
18
|
+
blue: fg(4),
|
|
19
|
+
magenta: fg(5),
|
|
20
|
+
cyan: fg(6),
|
|
21
|
+
white: fg(7),
|
|
22
|
+
brightblack: fg(8),
|
|
23
|
+
brightred: fg(9),
|
|
24
|
+
brightgreen: fg(10),
|
|
25
|
+
brightyellow: fg(11),
|
|
26
|
+
brightblue: fg(12),
|
|
27
|
+
brightmagenta: fg(13),
|
|
28
|
+
brightcyan: fg(14),
|
|
29
|
+
brightwhite: fg(15)
|
|
30
|
+
};
|
|
31
|
+
function resolveColor(name) {
|
|
32
|
+
if (COLOR_MAP[name]) return COLOR_MAP[name];
|
|
33
|
+
const n = parseInt(name, 10);
|
|
34
|
+
if (!isNaN(n) && n >= 0 && n <= 255) return fg(n);
|
|
35
|
+
return fg(14);
|
|
36
|
+
}
|
|
37
|
+
function buildDefaultLogo(accent) {
|
|
38
|
+
const a = accent;
|
|
39
|
+
const c1 = rgb(80, 200, 255);
|
|
40
|
+
const c2 = rgb(60, 160, 240);
|
|
41
|
+
const c3 = rgb(100, 120, 255);
|
|
42
|
+
const c4 = rgb(160, 100, 255);
|
|
43
|
+
const d = fg(8);
|
|
44
|
+
const lines = [
|
|
45
|
+
`${a} ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄${RST}`,
|
|
46
|
+
`${a} ▄██${c1}▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀${a}██▄${RST}`,
|
|
47
|
+
`${a} ▄██${c1}▀ ${a}██▄${RST}`,
|
|
48
|
+
`${a} ██${c1}▀ ${c1}██ ▀ ████ ████ ${a}██${RST}`,
|
|
49
|
+
`${a} ██${c2} ${c2}██ █ █▀ █ █ ${a}██${RST}`,
|
|
50
|
+
`${a} ██${c3} ${c3}██ █ ███ █ █ ${a}██${RST}`,
|
|
51
|
+
`${a} ██${c3} ${c3}██ █ █▄ █ █ ${a}██${RST}`,
|
|
52
|
+
`${a} ██${c4} ${c4}██████ █ ██ ████ ${a}██${RST}`,
|
|
53
|
+
`${a} ▀██${c4}▄ ${a}██▀${RST}`,
|
|
54
|
+
`${a} ▀██${c4}▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄${a}██▀${RST}`,
|
|
55
|
+
`${a} ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀${RST}`,
|
|
56
|
+
`${d} the browser is the${RST}`,
|
|
57
|
+
`${d} kernel${RST}`
|
|
58
|
+
];
|
|
59
|
+
return { lines, width: 38 };
|
|
60
|
+
}
|
|
61
|
+
function buildSmallLogo(accent) {
|
|
62
|
+
const a = accent;
|
|
63
|
+
const lines = [
|
|
64
|
+
`${a} ▗▖ ▀ ▗▀▀ ▗▀▀▖${RST}`,
|
|
65
|
+
`${a} ▐▌ █ ▐▀ ▐ ▐${RST}`,
|
|
66
|
+
`${a} ▐▙▄▖ █ ▐ ▝▀▀▘${RST}`
|
|
67
|
+
];
|
|
68
|
+
return { lines, width: 24 };
|
|
69
|
+
}
|
|
70
|
+
function buildNoneLogo() {
|
|
71
|
+
return { lines: [], width: 0 };
|
|
72
|
+
}
|
|
73
|
+
function buildCustomLogo(raw, accent) {
|
|
74
|
+
const lines = raw.split("\n").map((l) => `${accent}${l}${RST}`);
|
|
75
|
+
let maxWidth = 0;
|
|
76
|
+
for (const l of raw.split("\n")) {
|
|
77
|
+
if (l.length > maxWidth) maxWidth = l.length;
|
|
78
|
+
}
|
|
79
|
+
return { lines, width: maxWidth + 2 };
|
|
80
|
+
}
|
|
81
|
+
const DEFAULT_CONFIG = {
|
|
82
|
+
logo: "default",
|
|
83
|
+
color: "brightcyan",
|
|
84
|
+
separator: "",
|
|
85
|
+
modules: [
|
|
86
|
+
"title",
|
|
87
|
+
"separator",
|
|
88
|
+
"os",
|
|
89
|
+
"host",
|
|
90
|
+
"kernel",
|
|
91
|
+
"uptime",
|
|
92
|
+
"packages",
|
|
93
|
+
"shell",
|
|
94
|
+
"terminal",
|
|
95
|
+
"cpu",
|
|
96
|
+
"memory",
|
|
97
|
+
"disk",
|
|
98
|
+
"locale",
|
|
99
|
+
"break",
|
|
100
|
+
"colors"
|
|
101
|
+
]
|
|
102
|
+
};
|
|
103
|
+
function loadConfig(vfs) {
|
|
104
|
+
const paths = [
|
|
105
|
+
"/home/user/.config/fastfetch/config.json",
|
|
106
|
+
"/home/user/.fastfetchrc"
|
|
107
|
+
];
|
|
108
|
+
for (const p of paths) {
|
|
109
|
+
try {
|
|
110
|
+
const raw = vfs.readFileString(p);
|
|
111
|
+
const parsed = JSON.parse(raw);
|
|
112
|
+
return {
|
|
113
|
+
logo: parsed.logo ?? DEFAULT_CONFIG.logo,
|
|
114
|
+
color: parsed.color ?? DEFAULT_CONFIG.color,
|
|
115
|
+
separator: parsed.separator ?? DEFAULT_CONFIG.separator,
|
|
116
|
+
modules: Array.isArray(parsed.modules) ? parsed.modules : DEFAULT_CONFIG.modules
|
|
117
|
+
};
|
|
118
|
+
} catch {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return DEFAULT_CONFIG;
|
|
122
|
+
}
|
|
123
|
+
function formatUptime() {
|
|
124
|
+
const ms = performance.now();
|
|
125
|
+
const totalSeconds = Math.floor(ms / 1e3);
|
|
126
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
127
|
+
const hours = Math.floor(totalSeconds % 86400 / 3600);
|
|
128
|
+
const mins = Math.floor(totalSeconds % 3600 / 60);
|
|
129
|
+
const parts = [];
|
|
130
|
+
if (days > 0) parts.push(`${days} day${days !== 1 ? "s" : ""}`);
|
|
131
|
+
if (hours > 0) parts.push(`${hours} hour${hours !== 1 ? "s" : ""}`);
|
|
132
|
+
parts.push(`${mins} min${mins !== 1 ? "s" : ""}`);
|
|
133
|
+
return parts.join(", ");
|
|
134
|
+
}
|
|
135
|
+
function humanSize(bytes) {
|
|
136
|
+
if (bytes < 1024) return bytes + " B";
|
|
137
|
+
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + " KiB";
|
|
138
|
+
if (bytes < 1024 * 1024 * 1024) return (bytes / (1024 * 1024)).toFixed(1) + " MiB";
|
|
139
|
+
return (bytes / (1024 * 1024 * 1024)).toFixed(2) + " GiB";
|
|
140
|
+
}
|
|
141
|
+
function getMemoryInfo() {
|
|
142
|
+
const perf = performance;
|
|
143
|
+
if (perf.memory) {
|
|
144
|
+
const used = perf.memory.usedJSHeapSize;
|
|
145
|
+
const total = perf.memory.jsHeapSizeLimit;
|
|
146
|
+
const pct = Math.round(used / total * 100);
|
|
147
|
+
return `${humanSize(used)} / ${humanSize(total)} (${pct}%)`;
|
|
148
|
+
}
|
|
149
|
+
return "N/A";
|
|
150
|
+
}
|
|
151
|
+
function getDiskInfo(vfs) {
|
|
152
|
+
let totalBytes = 0;
|
|
153
|
+
let totalFiles = 0;
|
|
154
|
+
function walk(dir) {
|
|
155
|
+
try {
|
|
156
|
+
for (const entry of vfs.readdir(dir)) {
|
|
157
|
+
const full = dir === "/" ? "/" + entry.name : dir + "/" + entry.name;
|
|
158
|
+
if (entry.type === "file") {
|
|
159
|
+
totalFiles++;
|
|
160
|
+
totalBytes += vfs.stat(full).size;
|
|
161
|
+
} else {
|
|
162
|
+
walk(full);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
} catch {
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
walk("/");
|
|
169
|
+
const totalSpace = 256 * 1024 * 1024;
|
|
170
|
+
return `${humanSize(totalBytes)} / ${humanSize(totalSpace)} (${totalFiles} files)`;
|
|
171
|
+
}
|
|
172
|
+
function getBrowser() {
|
|
173
|
+
if (typeof navigator === "undefined") return "Unknown";
|
|
174
|
+
const ua = navigator.userAgent;
|
|
175
|
+
if (ua.includes("Firefox/")) {
|
|
176
|
+
const m = ua.match(/Firefox\/([\d.]+)/);
|
|
177
|
+
return m ? `Firefox ${m[1]}` : "Firefox";
|
|
178
|
+
}
|
|
179
|
+
if (ua.includes("Edg/")) {
|
|
180
|
+
const m = ua.match(/Edg\/([\d.]+)/);
|
|
181
|
+
return m ? `Edge ${m[1]}` : "Edge";
|
|
182
|
+
}
|
|
183
|
+
if (ua.includes("Chrome/")) {
|
|
184
|
+
const m = ua.match(/Chrome\/([\d.]+)/);
|
|
185
|
+
return m ? `Chrome ${m[1]}` : "Chrome";
|
|
186
|
+
}
|
|
187
|
+
if (ua.includes("Safari/")) {
|
|
188
|
+
const m = ua.match(/Version\/([\d.]+)/);
|
|
189
|
+
return m ? `Safari ${m[1]}` : "Safari";
|
|
190
|
+
}
|
|
191
|
+
return "Unknown";
|
|
192
|
+
}
|
|
193
|
+
function getPlatform() {
|
|
194
|
+
if (typeof navigator === "undefined") return "Unknown";
|
|
195
|
+
const ua = navigator.userAgent;
|
|
196
|
+
if (ua.includes("Mac OS X")) {
|
|
197
|
+
const m = ua.match(/Mac OS X ([\d_]+)/);
|
|
198
|
+
return m ? `macOS ${m[1].replace(/_/g, ".")}` : "macOS";
|
|
199
|
+
}
|
|
200
|
+
if (ua.includes("Windows NT")) {
|
|
201
|
+
const m = ua.match(/Windows NT ([\d.]+)/);
|
|
202
|
+
const ver = m ? m[1] : "";
|
|
203
|
+
if (ver === "10.0") return "Windows 10+";
|
|
204
|
+
return `Windows NT ${ver}`;
|
|
205
|
+
}
|
|
206
|
+
if (ua.includes("Linux")) return "Linux";
|
|
207
|
+
if (ua.includes("Android")) return "Android";
|
|
208
|
+
if (ua.includes("iPhone") || ua.includes("iPad")) return "iOS";
|
|
209
|
+
return "Unknown";
|
|
210
|
+
}
|
|
211
|
+
function getCPU() {
|
|
212
|
+
if (typeof navigator !== "undefined" && navigator.hardwareConcurrency) {
|
|
213
|
+
return `${navigator.hardwareConcurrency} cores`;
|
|
214
|
+
}
|
|
215
|
+
return "N/A";
|
|
216
|
+
}
|
|
217
|
+
function getLocale() {
|
|
218
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
219
|
+
return navigator.language;
|
|
220
|
+
}
|
|
221
|
+
return "en-US";
|
|
222
|
+
}
|
|
223
|
+
function getBinCount(vfs) {
|
|
224
|
+
try {
|
|
225
|
+
return vfs.readdir("/bin").length + 20;
|
|
226
|
+
} catch {
|
|
227
|
+
return 80;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function colorBlocks() {
|
|
231
|
+
let normal = "";
|
|
232
|
+
let bright = "";
|
|
233
|
+
for (let i = 0; i < 8; i++) normal += `${bg(i)} ${RST}`;
|
|
234
|
+
for (let i = 8; i < 16; i++) bright += `${bg(i)} ${RST}`;
|
|
235
|
+
return [normal, bright];
|
|
236
|
+
}
|
|
237
|
+
function resolveModule(mod, ctx, labelColor, separator) {
|
|
238
|
+
const lbl = (s, width) => `${BOLD}${labelColor}${s.padEnd(width)}${RST}${separator}`;
|
|
239
|
+
const W = 10;
|
|
240
|
+
switch (mod) {
|
|
241
|
+
case "title":
|
|
242
|
+
return `${BOLD}${labelColor}${ctx.user}${RST}@${BOLD}${labelColor}${ctx.hostname}${RST}`;
|
|
243
|
+
case "separator":
|
|
244
|
+
return `${fg(8)}${"─".repeat(ctx.user.length + 1 + ctx.hostname.length)}${RST}`;
|
|
245
|
+
case "os":
|
|
246
|
+
return `${lbl("OS", W)}Lifo 1.0.0 (wasm)`;
|
|
247
|
+
case "host":
|
|
248
|
+
return `${lbl("Host", W)}${getBrowser()} on ${getPlatform()}`;
|
|
249
|
+
case "kernel":
|
|
250
|
+
return `${lbl("Kernel", W)}Lifo vfs+shell 1.0.0`;
|
|
251
|
+
case "uptime":
|
|
252
|
+
return `${lbl("Uptime", W)}${formatUptime()}`;
|
|
253
|
+
case "packages":
|
|
254
|
+
return `${lbl("Packages", W)}${getBinCount(ctx.vfs)} (builtins + commands)`;
|
|
255
|
+
case "shell":
|
|
256
|
+
return `${lbl("Shell", W)}lifo-sh`;
|
|
257
|
+
case "terminal":
|
|
258
|
+
return `${lbl("Terminal", W)}xterm.js (${ctx.cols}x${ctx.rows})`;
|
|
259
|
+
case "cpu":
|
|
260
|
+
return `${lbl("CPU", W)}${getCPU()}`;
|
|
261
|
+
case "memory":
|
|
262
|
+
return `${lbl("Memory", W)}${getMemoryInfo()}`;
|
|
263
|
+
case "disk": {
|
|
264
|
+
return `${lbl("Disk (/)", W)}${getDiskInfo(ctx.vfs)}`;
|
|
265
|
+
}
|
|
266
|
+
case "locale":
|
|
267
|
+
return `${lbl("Locale", W)}${getLocale()}`;
|
|
268
|
+
case "colors": {
|
|
269
|
+
const [n, b] = colorBlocks();
|
|
270
|
+
return n + "\n" + b;
|
|
271
|
+
}
|
|
272
|
+
case "break":
|
|
273
|
+
return "";
|
|
274
|
+
default:
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const command = async (ctx) => {
|
|
279
|
+
const config = loadConfig(ctx.vfs);
|
|
280
|
+
if (ctx.args.includes("--help") || ctx.args.includes("-h")) {
|
|
281
|
+
ctx.stdout.write(`Usage: fastfetch [--logo default|small|none] [--color COLOR]
|
|
282
|
+
|
|
283
|
+
Config file: ~/.config/fastfetch/config.json
|
|
284
|
+
|
|
285
|
+
Example config:
|
|
286
|
+
{
|
|
287
|
+
"logo": "default",
|
|
288
|
+
"color": "brightcyan",
|
|
289
|
+
"separator": "",
|
|
290
|
+
"modules": [
|
|
291
|
+
"title", "separator", "os", "host", "kernel",
|
|
292
|
+
"uptime", "packages", "shell", "terminal",
|
|
293
|
+
"cpu", "memory", "disk", "locale",
|
|
294
|
+
"break", "colors"
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
Available modules:
|
|
299
|
+
title, separator, os, host, kernel, uptime, packages,
|
|
300
|
+
shell, terminal, cpu, memory, disk, locale, colors, break
|
|
301
|
+
|
|
302
|
+
Available logos: default, small, none (or put custom ASCII in config)
|
|
303
|
+
|
|
304
|
+
Colors: black, red, green, yellow, blue, magenta, cyan, white,
|
|
305
|
+
brightblack, brightred, brightgreen, brightyellow,
|
|
306
|
+
brightblue, brightmagenta, brightcyan, brightwhite,
|
|
307
|
+
or a number 0-255 for 256-color palette
|
|
308
|
+
`);
|
|
309
|
+
return 0;
|
|
310
|
+
}
|
|
311
|
+
let logoChoice = config.logo;
|
|
312
|
+
let colorChoice = config.color;
|
|
313
|
+
for (let i = 0; i < ctx.args.length; i++) {
|
|
314
|
+
if ((ctx.args[i] === "--logo" || ctx.args[i] === "-l") && i + 1 < ctx.args.length) {
|
|
315
|
+
logoChoice = ctx.args[++i];
|
|
316
|
+
}
|
|
317
|
+
if ((ctx.args[i] === "--color" || ctx.args[i] === "-c") && i + 1 < ctx.args.length) {
|
|
318
|
+
colorChoice = ctx.args[++i];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const isKnownColor = COLOR_MAP[colorChoice] !== void 0 || !isNaN(parseInt(colorChoice, 10)) && parseInt(colorChoice, 10) >= 0 && parseInt(colorChoice, 10) <= 255;
|
|
322
|
+
if (!isKnownColor) {
|
|
323
|
+
ctx.stderr.write(`fastfetch: unknown color '${colorChoice}', using default (brightcyan)
|
|
324
|
+
`);
|
|
325
|
+
}
|
|
326
|
+
const accent = resolveColor(colorChoice);
|
|
327
|
+
let logo;
|
|
328
|
+
if (logoChoice === "default") {
|
|
329
|
+
logo = buildDefaultLogo(accent);
|
|
330
|
+
} else if (logoChoice === "small") {
|
|
331
|
+
logo = buildSmallLogo(accent);
|
|
332
|
+
} else if (logoChoice === "none") {
|
|
333
|
+
logo = buildNoneLogo();
|
|
334
|
+
} else {
|
|
335
|
+
try {
|
|
336
|
+
const raw = ctx.vfs.readFileString(logoChoice);
|
|
337
|
+
logo = buildCustomLogo(raw, accent);
|
|
338
|
+
} catch {
|
|
339
|
+
logo = buildDefaultLogo(accent);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
const user = ctx.env.USER || "user";
|
|
343
|
+
const hostname = ctx.env.HOSTNAME || "lifo";
|
|
344
|
+
const cols = parseInt(ctx.env["COLUMNS"] || "80", 10);
|
|
345
|
+
const rows = parseInt(ctx.env["LINES"] || "24", 10);
|
|
346
|
+
const modCtx = { user, hostname, cols, rows, vfs: ctx.vfs };
|
|
347
|
+
const infoLines = [];
|
|
348
|
+
for (const mod of config.modules) {
|
|
349
|
+
const result = resolveModule(mod, modCtx, accent, config.separator);
|
|
350
|
+
if (result !== null) {
|
|
351
|
+
for (const line of result.split("\n")) {
|
|
352
|
+
infoLines.push(line);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const maxLines = Math.max(logo.lines.length, infoLines.length);
|
|
357
|
+
let output = "\n";
|
|
358
|
+
const gap = " ";
|
|
359
|
+
for (let i = 0; i < maxLines; i++) {
|
|
360
|
+
const logoLine = i < logo.lines.length ? logo.lines[i] : "";
|
|
361
|
+
const infoLine = i < infoLines.length ? infoLines[i] : "";
|
|
362
|
+
if (logo.width > 0) {
|
|
363
|
+
if (i < logo.lines.length) {
|
|
364
|
+
output += logoLine + gap + infoLine + "\n";
|
|
365
|
+
} else {
|
|
366
|
+
output += " ".repeat(logo.width) + gap + infoLine + "\n";
|
|
367
|
+
}
|
|
368
|
+
} else {
|
|
369
|
+
output += infoLine + "\n";
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
output += "\n";
|
|
373
|
+
ctx.stdout.write(output);
|
|
374
|
+
return 0;
|
|
375
|
+
};
|
|
376
|
+
export {
|
|
377
|
+
command as default
|
|
378
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { r as resolve, e as extname, V as VFSError } from "./index-GLjTMF7C.js";
|
|
2
|
+
const extTypes = {
|
|
3
|
+
".txt": "ASCII text",
|
|
4
|
+
".md": "Markdown text",
|
|
5
|
+
".js": "JavaScript source",
|
|
6
|
+
".ts": "TypeScript source",
|
|
7
|
+
".json": "JSON data",
|
|
8
|
+
".html": "HTML document",
|
|
9
|
+
".css": "CSS stylesheet",
|
|
10
|
+
".sh": "Shell script",
|
|
11
|
+
".py": "Python script",
|
|
12
|
+
".xml": "XML document",
|
|
13
|
+
".yaml": "YAML data",
|
|
14
|
+
".yml": "YAML data",
|
|
15
|
+
".csv": "CSV data",
|
|
16
|
+
".svg": "SVG image",
|
|
17
|
+
".png": "PNG image data",
|
|
18
|
+
".jpg": "JPEG image data",
|
|
19
|
+
".gif": "GIF image data"
|
|
20
|
+
};
|
|
21
|
+
function isText(data) {
|
|
22
|
+
for (let i = 0; i < Math.min(data.length, 512); i++) {
|
|
23
|
+
const b = data[i];
|
|
24
|
+
if (b === 9 || b === 10 || b === 13) continue;
|
|
25
|
+
if (b >= 32 && b <= 126) continue;
|
|
26
|
+
if (b >= 128) continue;
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
const command = async (ctx) => {
|
|
32
|
+
if (ctx.args.length === 0) {
|
|
33
|
+
ctx.stderr.write("file: missing operand\n");
|
|
34
|
+
return 1;
|
|
35
|
+
}
|
|
36
|
+
let exitCode = 0;
|
|
37
|
+
for (const arg of ctx.args) {
|
|
38
|
+
const path = resolve(ctx.cwd, arg);
|
|
39
|
+
try {
|
|
40
|
+
const st = ctx.vfs.stat(path);
|
|
41
|
+
if (st.type === "directory") {
|
|
42
|
+
ctx.stdout.write(`${arg}: directory
|
|
43
|
+
`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (st.size === 0) {
|
|
47
|
+
ctx.stdout.write(`${arg}: empty
|
|
48
|
+
`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const ext = extname(arg);
|
|
52
|
+
if (ext && extTypes[ext]) {
|
|
53
|
+
ctx.stdout.write(`${arg}: ${extTypes[ext]}
|
|
54
|
+
`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const data = ctx.vfs.readFile(path);
|
|
58
|
+
if (isText(data)) {
|
|
59
|
+
ctx.stdout.write(`${arg}: ASCII text
|
|
60
|
+
`);
|
|
61
|
+
} else {
|
|
62
|
+
ctx.stdout.write(`${arg}: data
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
if (e instanceof VFSError) {
|
|
67
|
+
ctx.stderr.write(`file: ${arg}: ${e.message}
|
|
68
|
+
`);
|
|
69
|
+
exitCode = 1;
|
|
70
|
+
} else {
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return exitCode;
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
command as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { r as resolve, V as VFSError, g as globMatch } from "./index-GLjTMF7C.js";
|
|
2
|
+
const command = async (ctx) => {
|
|
3
|
+
let searchPath = ".";
|
|
4
|
+
let namePattern = "";
|
|
5
|
+
let typeFilter = "";
|
|
6
|
+
let maxDepth = Infinity;
|
|
7
|
+
for (let i = 0; i < ctx.args.length; i++) {
|
|
8
|
+
const arg = ctx.args[i];
|
|
9
|
+
if (arg === "-name" && i + 1 < ctx.args.length) {
|
|
10
|
+
namePattern = ctx.args[++i];
|
|
11
|
+
} else if (arg === "-type" && i + 1 < ctx.args.length) {
|
|
12
|
+
typeFilter = ctx.args[++i];
|
|
13
|
+
} else if (arg === "-maxdepth" && i + 1 < ctx.args.length) {
|
|
14
|
+
maxDepth = parseInt(ctx.args[++i], 10);
|
|
15
|
+
} else if (!arg.startsWith("-")) {
|
|
16
|
+
searchPath = arg;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const absPath = resolve(ctx.cwd, searchPath);
|
|
20
|
+
function walk(dirPath, depth) {
|
|
21
|
+
if (depth > maxDepth) return;
|
|
22
|
+
try {
|
|
23
|
+
const entries = ctx.vfs.readdir(dirPath);
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
const fullPath = dirPath === "/" ? "/" + entry.name : dirPath + "/" + entry.name;
|
|
26
|
+
let matches = true;
|
|
27
|
+
if (namePattern) {
|
|
28
|
+
matches = globMatch(namePattern, entry.name);
|
|
29
|
+
}
|
|
30
|
+
if (typeFilter) {
|
|
31
|
+
if (typeFilter === "f" && entry.type !== "file") matches = false;
|
|
32
|
+
if (typeFilter === "d" && entry.type !== "directory") matches = false;
|
|
33
|
+
}
|
|
34
|
+
if (matches) {
|
|
35
|
+
ctx.stdout.write(fullPath + "\n");
|
|
36
|
+
}
|
|
37
|
+
if (entry.type === "directory") {
|
|
38
|
+
walk(fullPath, depth + 1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const stat = ctx.vfs.stat(absPath);
|
|
46
|
+
if (stat.type !== "directory") {
|
|
47
|
+
ctx.stdout.write(absPath + "\n");
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
} catch (e) {
|
|
51
|
+
if (e instanceof VFSError) {
|
|
52
|
+
ctx.stderr.write(`find: '${searchPath}': ${e.message}
|
|
53
|
+
`);
|
|
54
|
+
return 1;
|
|
55
|
+
}
|
|
56
|
+
throw e;
|
|
57
|
+
}
|
|
58
|
+
walk(absPath, 1);
|
|
59
|
+
return 0;
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
command as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function humanSize(bytes) {
|
|
2
|
+
if (bytes < 1024) return bytes + "B";
|
|
3
|
+
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + "K";
|
|
4
|
+
if (bytes < 1024 * 1024 * 1024) return (bytes / (1024 * 1024)).toFixed(1) + "M";
|
|
5
|
+
return (bytes / (1024 * 1024 * 1024)).toFixed(1) + "G";
|
|
6
|
+
}
|
|
7
|
+
const command = async (ctx) => {
|
|
8
|
+
let human = false;
|
|
9
|
+
for (const arg of ctx.args) {
|
|
10
|
+
if (arg === "-h") human = true;
|
|
11
|
+
}
|
|
12
|
+
const perf = performance;
|
|
13
|
+
if (perf.memory) {
|
|
14
|
+
const total = perf.memory.jsHeapSizeLimit;
|
|
15
|
+
const used = perf.memory.usedJSHeapSize;
|
|
16
|
+
const free = total - used;
|
|
17
|
+
if (human) {
|
|
18
|
+
ctx.stdout.write(" total used free\n");
|
|
19
|
+
ctx.stdout.write(`Mem: ${humanSize(total).padStart(10)} ${humanSize(used).padStart(10)} ${humanSize(free).padStart(10)}
|
|
20
|
+
`);
|
|
21
|
+
} else {
|
|
22
|
+
ctx.stdout.write(" total used free\n");
|
|
23
|
+
ctx.stdout.write(`Mem: ${String(total).padStart(10)} ${String(used).padStart(10)} ${String(free).padStart(10)}
|
|
24
|
+
`);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
ctx.stdout.write("Memory information not available in this browser\n");
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
command as default
|
|
33
|
+
};
|