Skip to content

Commit 66755a7

Browse files
committed
Fix readme and typings
1 parent f87dedd commit 66755a7

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ CommonJS format
8181
```js
8282
const metavm = require('metavm');
8383

84-
const ms = await metavm.readScript('./examples/cjssimple.js', {
84+
const ms = await metavm.readScript('./examples/cjs/simple.js', {
8585
type: metavm.MODULE_TYPE.COMMONJS,
8686
});
8787
console.log(ms.exports);
88-
// { field: 'value', add: [Function: add], sub:[Function: sub] }
88+
// { field: 'value', add: [Function: add], sub: [Function: sub] }
8989
```
9090

9191
## License & Contributors

metavm.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Context, Script, ScriptOptions } from 'node:vm';
22

33
export const EMPTY_CONTEXT: Context;
4+
export const EMPTY_CJS: Context;
45
export const COMMON_CONTEXT: Context;
56
export const NODE_CONTEXT: Context;
67

@@ -12,6 +13,7 @@ export function createContext(
1213
): Context;
1314

1415
export enum MODULE_TYPE {
16+
AUTO = 0,
1517
METARHIA = 1,
1618
COMMONJS = 2,
1719
ECMA = 3,

0 commit comments

Comments
 (0)