Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 74e4aa1

Browse files
committed
0.3.3
1 parent 9250e15 commit 74e4aa1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
NodeJS ES Module Loader
22
===
33

4-
Loads ES modules with CJS interop in Node according to https://github.com/nodejs/node-eps/blob/master/002-es6-modules.md.
4+
Loads ES modules and WebAssembly with CJS interop in Node, roughly according to https://github.com/nodejs/node-eps/blob/master/002-es6-modules.md.
55

66
Follows the NodeJS resolution algorithm, loading modules first as CJS and then falling back to ES on import or export syntax failures.
77
This effectively provides the "export {}" assumption to load an ES module.
88

9+
This does mean a double-parse, over the mjs approach currently being taken by Node.
10+
911
Built with the ES Module Loader polyfill 1.0 branch at https://github.com/ModuleLoader/es-module-loader.
1012

1113
### Installation
@@ -27,6 +29,7 @@ For example, where `module.js` contains:
2729
```javascript
2830
import fs from 'fs';
2931
import {fn} from './local-es-module.js';
32+
import {wasmFn} from './local-wasm-binary.wasm';
3033
```
3134

3235
Note that only the default import form for CommonJS modules is supported.
@@ -41,6 +44,12 @@ export function lazyLoad(path) {
4144

4245
Source maps for errors are fully supported through the [source-map-support project](https://github.com/evanw/node-source-map-support).
4346

47+
Wasm requires running with the `--expose-wasm` flag in Node currently (currently supporting Node 8 nightly only):
48+
49+
```
50+
node --expose-wasm node_modules/.bin/node-esml module.js
51+
```
52+
4453
Source maps also work in Node 6 with the `node --inspect` flag via:
4554

4655
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-es-module-loader",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Loads ES modules with CJS interop in Node",
55
"main": "dist/node-es-module-loader.js",
66
"bin": {

0 commit comments

Comments
 (0)