@freestyle-sh/with-nodejs 0.1.0 → 0.2.0

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/index.d.ts CHANGED
@@ -19,7 +19,9 @@ declare class VmNodeJs extends VmWith<NodeJsRuntimeInstance> implements VmJavaSc
19
19
  declare class NodeJsRuntimeInstance extends VmWithInstance implements VmJavaScriptRuntimeInstance {
20
20
  builder: VmNodeJs;
21
21
  constructor(builder: VmNodeJs);
22
- runCode<Result extends JSONValue = any>(code: string): Promise<RunCodeResponse<Result>>;
22
+ runCode<Result extends JSONValue = any>({ code, }: {
23
+ code: string;
24
+ }): Promise<RunCodeResponse<Result>>;
23
25
  }
24
26
 
25
27
  export { VmNodeJs };
package/dist/index.js CHANGED
@@ -63,7 +63,9 @@ class NodeJsRuntimeInstance extends VmWithInstance {
63
63
  super();
64
64
  this.builder = builder;
65
65
  }
66
- async runCode(code) {
66
+ async runCode({
67
+ code
68
+ }) {
67
69
  const result = await this.vm.exec({
68
70
  command: `node -e "${code.replace(/"/g, '\\"')}"`
69
71
  });
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@freestyle-sh/with-nodejs",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "dependencies": {
6
- "freestyle-sandboxes": "^0.1.1",
7
- "@freestyle-sh/with-type-js": "^0.1.0"
6
+ "freestyle-sandboxes": "^0.1.2",
7
+ "@freestyle-sh/with-type-js": "^0.2.0"
8
8
  },
9
9
  "type": "module",
10
10
  "main": "./dist/index.js",