Skip to content

Commit 212c345

Browse files
authored
Use node: prefix when importing code node modules. NFC (#22017)
See https://stateful.com/blog/node-18-prefix-only-modules
1 parent 845ad34 commit 212c345

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/compiler.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
// LLVM => JavaScript compiler, main entry point
99

10-
import * as fs from 'fs';
11-
import * as path from 'path';
12-
import * as url from 'url';
10+
import * as fs from 'node:fs';
11+
import * as path from 'node:path';
12+
import * as url from 'node:url';
1313

1414
import {Benchmarker, applySettings, assert, loadSettingsFile, printErr, read} from './utility.mjs';
1515

src/modules.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7-
import * as path from 'path';
7+
import * as path from 'node:path';
88

99
import {
1010
isDecorator,

src/utility.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
// General JS utilities - things that might be useful in any JS project.
88
// Nothing specific to Emscripten appears here.
99

10-
import * as url from 'url';
11-
import * as path from 'path';
12-
import * as fs from 'fs';
13-
import * as vm from 'vm';
14-
import assert from 'assert';
10+
import * as url from 'node:url';
11+
import * as path from 'node:path';
12+
import * as fs from 'node:fs';
13+
import * as vm from 'node:vm';
14+
import assert from 'node:assert';
1515

1616
export {assert};
1717

tools/acorn-optimizer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as acorn from 'acorn';
44
import * as terser from '../third_party/terser/terser.js';
5-
import * as fs from 'fs';
5+
import * as fs from 'node:fs';
66

77
// Utilities
88

tools/lz4-compress.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// University of Illinois/NCSA Open Source License. Both these licenses can be
55
// found in the LICENSE file.
66

7-
import * as fs from 'fs';
8-
import * as path from 'path';
7+
import * as fs from 'node:fs';
8+
import * as path from 'node:path';
99

1010
function print(x) {
1111
process.stdout.write(x + '\n');

tools/unsafe_optimizations.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** Implements a set of potentially unsafe JavaScript AST optimizations for aggressive code size optimizations.
44
Enabled when building with -sMINIMAL_RUNTIME=2 linker flag. */
55

6-
import * as fs from 'fs';
6+
import * as fs from 'node:fs';
77
import * as acorn from 'acorn';
88
import * as terser from '../third_party/terser/terser.js';
99

0 commit comments

Comments
 (0)