Skip to content

Commit 4fcbfdc

Browse files
Derek Lewiscodebytere
Derek Lewis
authored andcommitted
doc: normalize JavaScript code block info strings
Prior to this commit, JavaScript fenced code blocks in Markdown files had inconsistent info strings. This has been corrected to standardize on the one with the highest frequency in the doc/api/ dir. Stats: > 'js' => 1091, > 'javascript' => 2, PR-URL: #33531 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
1 parent 5436057 commit 4fcbfdc

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

doc/api/fs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4180,7 +4180,7 @@ recommended.
41804180
When `file` is a file descriptor, the behavior is almost identical to directly
41814181
calling `fs.write()` like:
41824182

4183-
```javascript
4183+
```js
41844184
fs.write(fd, Buffer.from(data, options.encoding), callback);
41854185
```
41864186

doc/api/stream.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ The `'readable'` event is emitted when there is data available to be read from
881881
the stream. In some cases, attaching a listener for the `'readable'` event will
882882
cause some amount of data to be read into an internal buffer.
883883

884-
```javascript
884+
```js
885885
const readable = getReadableStreamSomehow();
886886
readable.on('readable', function() {
887887
// There is some data to read now.

doc/guides/writing-tests.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ For example, look for `test-streams` when writing a test for `lib/streams.js`.
2929

3030
Let's analyze this basic test from the Node.js test suite:
3131

32-
```javascript
32+
```js
3333
'use strict'; // 1
3434
const common = require('../common'); // 2
3535
const fixtures = require('../common/fixtures'); // 3
@@ -57,7 +57,7 @@ server.listen(0, () => { // 14
5757

5858
### **Lines 1-3**
5959

60-
```javascript
60+
```js
6161
'use strict';
6262
const common = require('../common');
6363
const fixtures = require('../common/fixtures');
@@ -78,13 +78,13 @@ the test leaks variables into the global space. In situations where a test uses
7878
no functions or other properties exported by `common`, include it without
7979
assigning it to an identifier:
8080

81-
```javascript
81+
```js
8282
require('../common');
8383
```
8484

8585
### **Lines 5-6**
8686

87-
```javascript
87+
```js
8888
// This test ensures that the http-parser can handle UTF-8 characters
8989
// in the http header.
9090
```
@@ -94,7 +94,7 @@ designed to test.
9494

9595
### **Lines 8-9**
9696

97-
```javascript
97+
```js
9898
const assert = require('assert');
9999
const http = require('http');
100100
```
@@ -136,7 +136,7 @@ In the event a test needs a timer, consider using the
136136
`common.platformTimeout()` method. It allows setting specific timeouts
137137
depending on the platform:
138138

139-
```javascript
139+
```js
140140
const timer = setTimeout(fail, common.platformTimeout(4000));
141141
```
142142

@@ -155,7 +155,7 @@ One interesting case is `common.mustCall`. The use of `common.mustCall` may
155155
avoid the use of extra variables and the corresponding assertions. Let's
156156
explain this with a real test from the test suite.
157157

158-
```javascript
158+
```js
159159
'use strict';
160160
require('../common');
161161
const assert = require('assert');
@@ -189,7 +189,7 @@ const server = http.createServer((req, res) => {
189189

190190
This test could be greatly simplified by using `common.mustCall` like this:
191191

192-
```javascript
192+
```js
193193
'use strict';
194194
const common = require('../common');
195195
const http = require('http');
@@ -216,7 +216,7 @@ provides a simple countdown mechanism for tests that require a particular
216216
action to be taken after a given number of completed tasks (for instance,
217217
shutting down an HTTP server after a specific number of requests).
218218

219-
```javascript
219+
```js
220220
const Countdown = require('../common/countdown');
221221

222222
const countdown = new Countdown(2, () => {
@@ -237,7 +237,7 @@ hence, the test fail - in the case of an `unhandledRejection` event. It is
237237
possible to disable it with `common.disableCrashOnUnhandledRejection()` if
238238
needed.
239239

240-
```javascript
240+
```js
241241
const common = require('../common');
242242
const assert = require('assert');
243243
const fs = require('fs').promises;
@@ -257,7 +257,7 @@ test followed by the flags. For example, to allow a test to require some of the
257257
`internal/*` modules, add the `--expose-internals` flag.
258258
A test that would require `internal/freelist` could start like this:
259259

260-
```javascript
260+
```js
261261
'use strict';
262262

263263
// Flags: --expose-internals

0 commit comments

Comments
 (0)