Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: remove errant usage of node:cjs
  • Loading branch information
jeromecovington committed May 18, 2021
commit 7737f62ad57948e0af461061e30cfea24cca9fd7
8 changes: 4 additions & 4 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ module default import or its corresponding sugar syntax:

<!-- eslint-disable no-duplicate-imports -->
```js
import { default as cjs } from 'node:cjs';
import { default as cjs } from 'cjs';

// The following import statement is "syntax sugar" (equivalent but sweeter)
// for `{ default as cjsSugar }` in the above import statement:
import cjsSugar from 'node:cjs';
import cjsSugar from 'cjs';

console.log(cjs);
console.log(cjs === cjsSugar);
Expand All @@ -368,11 +368,11 @@ a namespace with a `default` export key pointing to the CommonJS
`module.exports` value.

This Module Namespace Exotic Object can be directly observed either when using
`import * as m from 'node:cjs'` or a dynamic import:
`import * as m from 'cjs'` or a dynamic import:

<!-- eslint-skip -->
```js
import * as m from 'node:cjs';
import * as m from 'cjs';
console.log(m);
console.log(m === await import('cjs'));
// Prints:
Expand Down