mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
This follows the EPS an allows the node CLI to have ESM as an entry point. `node ./example.mjs`. A newer V8 is needed for `import()` so that is not included. `import.meta` is still in specification stage so that also is not included. PR-URL: https://github.com/nodejs/node/pull/14369 Author: Bradley Farias <bradley.meck@gmail.com> Author: Guy Bedford <guybedford@gmail.com> Author: Jan Krems <jan.krems@groupon.com> Author: Timothy Gu <timothygu99@gmail.com> Author: Michaël Zasso <targos@protonmail.com> Author: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
11 lines
334 B
JavaScript
11 lines
334 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { spawn } = require('child_process');
|
|
|
|
const native = `${common.fixturesDir}/es-module-url/native.mjs`;
|
|
const child = spawn(process.execPath, ['--experimental-modules', native]);
|
|
child.on('exit', (code) => {
|
|
assert.strictEqual(code, 1);
|
|
});
|