2024-10-29 03:28:54 -03:00
|
|
|
// If process is undefined, we're not running in the node runtime let it go I
|
|
|
|
// guess?
|
|
|
|
if (typeof process !== "undefined") {
|
2024-11-15 21:44:05 -04:00
|
|
|
const nodeVersion = Number(process.versions.node.split(".", 1)[0]);
|
2024-10-29 03:28:54 -03:00
|
|
|
if (nodeVersion < 18) {
|
2024-11-15 21:44:05 -04:00
|
|
|
process.stderr.write(
|
|
|
|
`Node version must be >= 18, got version ${process.version}\n`,
|
|
|
|
);
|
2024-10-29 03:28:54 -03:00
|
|
|
process.exit(1);
|
|
|
|
}
|
2024-11-15 21:44:05 -04:00
|
|
|
Module.preRun = () => {
|
|
|
|
FS.mkdirTree("/lib/");
|
|
|
|
FS.mount(NODEFS, { root: __dirname + "/lib/" }, "/lib/");
|
|
|
|
};
|
2024-10-29 03:28:54 -03:00
|
|
|
}
|