Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1fd1395

Browse filesBrowse files
guybedfordMylesBorins
authored andcommitted
lib,doc: revert format name to cjs over commonjs
PR-URL: #18596 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent afc87c2 commit 1fd1395
Copy full SHA for 1fd1395

File tree

Expand file treeCollapse file tree

3 files changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ module. This can be one of the following:
133133
| `format` | Description |
134134
| --- | --- |
135135
| `"esm"` | Load a standard JavaScript module |
136-
| `"commonjs"` | Load a node-style CommonJS module |
136+
| `"cjs"` | Load a node-style CommonJS module |
137137
| `"builtin"` | Load a node builtin CommonJS module |
138138
| `"json"` | Load a JSON file |
139139
| `"addon"` | Load a [C++ Addon][addons] |
Collapse file

‎lib/internal/loader/DefaultResolve.js‎

Copy file name to clipboardExpand all lines: lib/internal/loader/DefaultResolve.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const extensionFormatMap = {
4444
'.mjs': 'esm',
4545
'.json': 'json',
4646
'.node': 'addon',
47-
'.js': 'commonjs'
47+
'.js': 'cjs'
4848
};
4949

5050
function resolve(specifier, parentURL) {
Collapse file

‎lib/internal/loader/Translators.js‎

Copy file name to clipboardExpand all lines: lib/internal/loader/Translators.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ translators.set('esm', async (url) => {
3232
// Strategy for loading a node-style CommonJS module
3333
const isWindows = process.platform === 'win32';
3434
const winSepRegEx = /\//g;
35-
translators.set('commonjs', async (url) => {
35+
translators.set('cjs', async (url) => {
3636
debug(`Translating CJSModule ${url}`);
3737
const pathname = internalURLModule.getPathFromURL(new URL(url));
3838
const module = CJSModule._cache[

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.