@bytecodealliance/preview2-shim 0.0.16 → 0.0.17

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/lib/nodejs/cli.js CHANGED
@@ -1,19 +1,9 @@
1
- let _env, _args = [], _cwd = null;
2
- export function _setEnv (envObj) {
3
- _env = Object.entries(envObj);
4
- }
1
+ import { argv, env, cwd } from 'node:process';
5
2
 
6
- export function _setArgs (args) {
7
- _args = args;
8
- }
9
-
10
- export function _setCwd (cwd) {
11
- _cwd = cwd;
12
- }
3
+ let _env = Object.entries(env), _args = argv, _cwd = cwd();
13
4
 
14
5
  export const environment = {
15
6
  getEnvironment () {
16
- if (!_env) _setEnv(process.env);
17
7
  return _env;
18
8
  },
19
9
  getArguments () {