Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-07-01 16:21:39 +0300
committerRich Trott <rtrott@gmail.com>2021-07-03 20:25:52 +0300
commite8b086228a627adaa6b8bcb7fc47b7574091543c (patch)
tree60c8c5ee6e64ab0589c4c49f2a66ea39274e1f6c /doc/api
parent8f3d0d6c6a9b6ef3400988dbc125338f0d8bf225 (diff)
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: https://github.com/nodejs/node/pull/39219 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/fs.md12
1 files changed, 0 insertions, 12 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index 0418415eb8f..2525df050ba 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -14,24 +14,20 @@ way modeled on standard POSIX functions.
To use the promise-based APIs:
```mjs
-// Using ESM Module syntax:
import * as fs from 'fs/promises';
```
```cjs
-// Using CommonJS syntax:
const fs = require('fs/promises');
```
To use the callback and sync APIs:
```mjs
-// Using ESM Module syntax:
import * as fs from 'fs';
```
```cjs
-// Using CommonJS syntax:
const fs = require('fs');
```
@@ -44,7 +40,6 @@ Promise-based operations return a promise that is fulfilled when the
asynchronous operation is complete.
```mjs
-// Using ESM Module syntax:
import { unlink } from 'fs/promises';
try {
@@ -56,7 +51,6 @@ try {
```
```cjs
-// Using CommonJS syntax
const { unlink } = require('fs/promises');
(async function(path) {
@@ -78,7 +72,6 @@ reserved for an exception. If the operation is completed successfully, then
the first argument is `null` or `undefined`.
```mjs
-// Using ESM syntax
import { unlink } from 'fs';
unlink('/tmp/hello', (err) => {
@@ -88,7 +81,6 @@ unlink('/tmp/hello', (err) => {
```
```cjs
-// Using CommonJS syntax
const { unlink } = require('fs');
unlink('/tmp/hello', (err) => {
@@ -108,7 +100,6 @@ execution until the operation is complete. Exceptions are thrown immediately
and can be handled using `try…catch`, or can be allowed to bubble up.
```mjs
-// Using ESM syntax
import { unlinkSync } from 'fs';
try {
@@ -120,7 +111,6 @@ try {
```
```cjs
-// Using CommonJS syntax
const { unlinkSync } = require('fs');
try {
@@ -6339,7 +6329,6 @@ It is important to correctly order the operations by awaiting the results
of one before invoking the other:
```mjs
-// Using ESM syntax
import { rename, stat } from 'fs/promises';
const from = '/tmp/hello';
@@ -6355,7 +6344,6 @@ try {
```
```cjs
-// Using CommonJS syntax
const { rename, stat } = require('fs/promises');
(async function(from, to) {