Skip to content

Commit db74a35

Browse files
Trotttargos
authored andcommitted
doc: remove unnecessary module format comments
Now that the docs have toggles for CJS vs. ESM, there is no need to include a comment explaining which module type is being used. PR-URL: #39219 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Zijian Liu <[email protected]>
1 parent ab9ccd0 commit db74a35

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Diff for: doc/api/fs.md

-12
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,20 @@ way modeled on standard POSIX functions.
1414
To use the promise-based APIs:
1515

1616
```mjs
17-
// Using ESM Module syntax:
1817
import * as fs from 'fs/promises';
1918
```
2019

2120
```cjs
22-
// Using CommonJS syntax:
2321
const fs = require('fs/promises');
2422
```
2523

2624
To use the callback and sync APIs:
2725

2826
```mjs
29-
// Using ESM Module syntax:
3027
import * as fs from 'fs';
3128
```
3229

3330
```cjs
34-
// Using CommonJS syntax:
3531
const fs = require('fs');
3632
```
3733

@@ -44,7 +40,6 @@ Promise-based operations return a promise that is fulfilled when the
4440
asynchronous operation is complete.
4541

4642
```mjs
47-
// Using ESM Module syntax:
4843
import { unlink } from 'fs/promises';
4944

5045
try {
@@ -56,7 +51,6 @@ try {
5651
```
5752

5853
```cjs
59-
// Using CommonJS syntax
6054
const { unlink } = require('fs/promises');
6155

6256
(async function(path) {
@@ -78,7 +72,6 @@ reserved for an exception. If the operation is completed successfully, then
7872
the first argument is `null` or `undefined`.
7973

8074
```mjs
81-
// Using ESM syntax
8275
import { unlink } from 'fs';
8376

8477
unlink('/tmp/hello', (err) => {
@@ -88,7 +81,6 @@ unlink('/tmp/hello', (err) => {
8881
```
8982

9083
```cjs
91-
// Using CommonJS syntax
9284
const { unlink } = require('fs');
9385

9486
unlink('/tmp/hello', (err) => {
@@ -108,7 +100,6 @@ execution until the operation is complete. Exceptions are thrown immediately
108100
and can be handled using `try…catch`, or can be allowed to bubble up.
109101

110102
```mjs
111-
// Using ESM syntax
112103
import { unlinkSync } from 'fs';
113104

114105
try {
@@ -120,7 +111,6 @@ try {
120111
```
121112

122113
```cjs
123-
// Using CommonJS syntax
124114
const { unlinkSync } = require('fs');
125115

126116
try {
@@ -6316,7 +6306,6 @@ It is important to correctly order the operations by awaiting the results
63166306
of one before invoking the other:
63176307
63186308
```mjs
6319-
// Using ESM syntax
63206309
import { rename, stat } from 'fs/promises';
63216310

63226311
const from = '/tmp/hello';
@@ -6332,7 +6321,6 @@ try {
63326321
```
63336322
63346323
```cjs
6335-
// Using CommonJS syntax
63366324
const { rename, stat } = require('fs/promises');
63376325

63386326
(async function(from, to) {

0 commit comments

Comments
 (0)