Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/wasi-js/src/bindings/node.ts
1067 views
1
import { randomFillSync } from "crypto";
2
import fs from "fs";
3
import { isatty as isTTY } from "tty";
4
import path from "path";
5
6
import { WASIBindings } from "../types";
7
8
const bindings: WASIBindings = {
9
hrtime: process.hrtime.bigint,
10
exit: (code: number) => {
11
process.exit(code);
12
},
13
kill: (signal: string) => {
14
process.kill(process.pid, signal);
15
},
16
randomFillSync,
17
isTTY,
18
fs,
19
path,
20
};
21
22
export default bindings;
23
24