Files
sashinexists/node_modules/@weborigami/origami/src/node.js
2024-12-07 13:18:31 +11:00

23 lines
531 B
JavaScript

import path from "node:path";
import process from "node:process";
import url from "node:url";
// Patch process.env to be a plain object. Among other things, this lets us dump
// the complete environment to the terminal with `ori @node/process/env`.
const patchedProcess = Object.create(null, {
...Object.getOwnPropertyDescriptors(process),
env: {
enumerable: true,
get: function () {
return Object.assign({}, process.env);
},
},
});
export default {
Buffer,
path,
process: patchedProcess,
url,
};