GeezerVison is showing github.com — doc: remove extraneous "for example" text · nodejs/node@8532251
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: doc/api/addons.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -292,7 +292,7 @@ Each of these examples using the following `binding.gyp` file: | 292 | 292 | ``` | 293 | 293 |
| 294 | 294 | In cases where there is more than one `.cc` file, simply add the additional | 295 | | -filename to the `sources` array. For example: | | 295 | +filename to the `sources` array: | 296 | 296 |
| 297 | 297 | ```json | 298 | 298 | "sources": ["addon.cc", "myexample.cc"] | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/async_hooks.md +1-7Lines changed: 1 addition & 7 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -451,8 +451,6 @@ Note that `resolve()` does not do any observable synchronous work. | 451 | 451 | rejected at this point, if the `Promise` was resolved by assuming the state | 452 | 452 | of another `Promise`. | 453 | 453 |
| 454 | | -For example: | 455 | | - | 456 | 454 | ```js | 457 | 455 | new Promise((resolve) => resolve(true)).then((a) => {}); | 458 | 456 | ``` | @@ -481,8 +479,6 @@ changes: | 481 | 479 | * Returns: {number} The `asyncId` of the current execution context. Useful to | 482 | 480 | track when something calls. | 483 | 481 |
| 484 | | -For example: | 485 | | - | 486 | 482 | ```js | 487 | 483 | const async_hooks = require('async_hooks'); | 488 | 484 |
| @@ -493,7 +489,7 @@ fs.open(path, 'r', (err, fd) => { | 493 | 489 | ``` | 494 | 490 |
| 495 | 491 | The ID returned from `executionAsyncId()` is related to execution timing, not | 496 | | -causality (which is covered by `triggerAsyncId()`). For example: | | 492 | +causality (which is covered by `triggerAsyncId()`): | 497 | 493 |
| 498 | 494 | ```js | 499 | 495 | const server = net.createServer(function onConnection(conn) { | @@ -517,8 +513,6 @@ See the section on [promise execution tracking][]. | 517 | 513 | * Returns: {number} The ID of the resource responsible for calling the callback | 518 | 514 | that is currently being executed. | 519 | 515 |
| 520 | | -For example: | 521 | | - | 522 | 516 | ```js | 523 | 517 | const server = net.createServer((conn) => { | 524 | 518 | // The resource that caused (or triggered) this callback to be called | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/buffer.md -4Lines changed: 0 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -930,8 +930,6 @@ added: v8.2.0 | 930 | 930 | For objects whose `valueOf()` function returns a value not strictly equal to | 931 | 931 | `object`, returns `Buffer.from(object.valueOf(), offsetOrEncoding, length)`. | 932 | 932 |
| 933 | | -For example: | 934 | | - | 935 | 933 | ```js | 936 | 934 | const buf = Buffer.from(new String('this is a test')); | 937 | 935 | // <Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74> | @@ -940,8 +938,6 @@ const buf = Buffer.from(new String('this is a test')); | 940 | 938 | For objects that support `Symbol.toPrimitive`, returns | 941 | 939 | `Buffer.from(object[Symbol.toPrimitive](), offsetOrEncoding, length)`. | 942 | 940 |
| 943 | | -For example: | 944 | | - | 945 | 941 | ```js | 946 | 942 | class Foo { | 947 | 943 | [Symbol.toPrimitive]() { | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/child_process.md -2Lines changed: 0 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -226,8 +226,6 @@ a Promise for an object with `stdout` and `stderr` properties. In case of an | 226 | 226 | error, a rejected promise is returned, with the same `error` object given in the | 227 | 227 | callback, but with an additional two properties `stdout` and `stderr`. | 228 | 228 |
| 229 | | -For example: | 230 | | - | 231 | 229 | ```js | 232 | 230 | const util = require('util'); | 233 | 231 | const exec = util.promisify(require('child_process').exec); | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/dns.md -6Lines changed: 0 additions & 6 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -114,8 +114,6 @@ Returns an array of IP address strings, formatted according to [rfc5952][], | 114 | 114 | that are currently configured for DNS resolution. A string will include a port | 115 | 115 | section if a custom port is used. | 116 | 116 |
| 117 | | -For example: | 118 | | - | 119 | 117 | <!-- eslint-disable semi--> | 120 | 118 | ```js | 121 | 119 | [ | @@ -369,8 +367,6 @@ function will contain an array of objects with the following properties: | 369 | 367 | * `order` | 370 | 368 | * `preference` | 371 | 369 |
| 372 | | -For example: | 373 | | - | 374 | 370 | <!-- eslint-skip --> | 375 | 371 | ```js | 376 | 372 | { | @@ -558,8 +554,6 @@ Sets the IP address and port of servers to be used when performing DNS | 558 | 554 | resolution. The `servers` argument is an array of [rfc5952][] formatted | 559 | 555 | addresses. If the port is the IANA default DNS port (53) it can be omitted. | 560 | 556 |
| 561 | | -For example: | 562 | | - | 563 | 557 | ```js | 564 | 558 | dns.setServers([ | 565 | 559 | '4.4.4.4', | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/domain.md -2Lines changed: 0 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -239,8 +239,6 @@ perhaps we would like to have a separate domain to use for each request. | 239 | 239 |
| 240 | 240 | That is possible via explicit binding. | 241 | 241 |
| 242 | | -For example: | 243 | | - | 244 | 242 | ```js | 245 | 243 | // create a top-level domain for the server | 246 | 244 | const domain = require('domain'); | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/errors.md +2-9Lines changed: 2 additions & 9 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -292,8 +292,6 @@ console.error(err.message); | 292 | 292 | The `error.stack` property is a string describing the point in the code at which | 293 | 293 | the `Error` was instantiated. | 294 | 294 |
| 295 | | -For example: | 296 | | - | 297 | 295 | ```txt | 298 | 296 | Error: Things keep happening! | 299 | 297 | at /home/gbusey/file.js:525:2 | @@ -368,8 +366,6 @@ detailed [here](#errors_system_errors). | 368 | 366 | A subclass of `Error` that indicates the failure of an assertion. Such errors | 369 | 367 | commonly indicate inequality of actual and expected value. | 370 | 368 |
| 371 | | -For example: | 372 | | - | 373 | 369 | ```js | 374 | 370 | assert.strictEqual(1, 2); | 375 | 371 | // AssertionError [ERR_ASSERTION]: 1 === 2 | @@ -381,8 +377,6 @@ A subclass of `Error` that indicates that a provided argument was not within the | 381 | 377 | set or range of acceptable values for a function; whether that is a numeric | 382 | 378 | range, or outside the set of options for a given function parameter. | 383 | 379 |
| 384 | | -For example: | 385 | | - | 386 | 380 | ```js | 387 | 381 | require('net').connect(-1); | 388 | 382 | // throws "RangeError: "port" option should be >= 0 and < 65536: -1" | @@ -1298,9 +1292,8 @@ compiled with ICU support. | 1298 | 1292 | <a id="ERR_NO_LONGER_SUPPORTED"></a> | 1299 | 1293 | ### ERR_NO_LONGER_SUPPORTED | 1300 | 1294 |
| 1301 | | -A Node.js API was called in an unsupported manner. | 1302 | | - | 1303 | | -For example: `Buffer.write(string, encoding, offset[, length])` | | 1295 | +A Node.js API was called in an unsupported manner, such as | | 1296 | +`Buffer.write(string, encoding, offset[, length])`. | 1304 | 1297 |
| 1305 | 1298 | <a id="ERR_OUT_OF_RANGE"></a> | 1306 | 1299 | ### ERR_OUT_OF_RANGE | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/fs.md -10Lines changed: 0 additions & 10 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -22,8 +22,6 @@ The arguments passed to the completion callback depend on the method, but the | 22 | 22 | first argument is always reserved for an exception. If the operation was | 23 | 23 | completed successfully, then the first argument will be `null` or `undefined`. | 24 | 24 |
| 25 | | -For example: | 26 | | - | 27 | 25 | ```js | 28 | 26 | const fs = require('fs'); | 29 | 27 |
| @@ -36,8 +34,6 @@ fs.unlink('/tmp/hello', (err) => { | 36 | 34 | Exceptions that occur using synchronous operations are thrown immediately and | 37 | 35 | may be handled using `try`/`catch`, or may be allowed to bubble up. | 38 | 36 |
| 39 | | -For example: | 40 | | - | 41 | 37 | ```js | 42 | 38 | const fs = require('fs'); | 43 | 39 |
| @@ -403,7 +399,6 @@ A `fs.Stats` object provides information about a file. | 403 | 399 | Objects returned from [`fs.stat()`][], [`fs.lstat()`][] and [`fs.fstat()`][] and | 404 | 400 | their synchronous counterparts are of this type. | 405 | 401 |
| 406 | | -For example: | 407 | 402 | ```console | 408 | 403 | Stats { | 409 | 404 | dev: 2114, | @@ -703,9 +698,6 @@ so introduces a race condition, since other processes may change the file's | 703 | 698 | state between the two calls. Instead, user code should open/read/write the | 704 | 699 | file directly and handle the error raised if the file is not accessible. | 705 | 700 |
| 706 | | -For example: | 707 | | - | 708 | | - | 709 | 701 | **write (NOT RECOMMENDED)** | 710 | 702 |
| 711 | 703 | ```js | @@ -1354,8 +1346,6 @@ so introduces a race condition, since other processes may change the file's | 1354 | 1346 | state between the two calls. Instead, user code should open/read/write the | 1355 | 1347 | file directly and handle the error raised if the file does not exist. | 1356 | 1348 |
| 1357 | | -For example: | 1358 | | - | 1359 | 1349 | **write (NOT RECOMMENDED)** | 1360 | 1350 |
| 1361 | 1351 | ```js | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/http2.md -4Lines changed: 0 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1094,8 +1094,6 @@ received for this stream from the connected HTTP/2 server. The listener is | 1094 | 1094 | invoked with two arguments: an Object containing the received | 1095 | 1095 | [HTTP2 Headers Object][], and flags associated with the headers. | 1096 | 1096 |
| 1097 | | -For example: | 1098 | | - | 1099 | 1097 | ```js | 1100 | 1098 | const http2 = require('http2'); | 1101 | 1099 | const client = http2.connect('https://localhost'); | @@ -2008,8 +2006,6 @@ keys will be serialized to lower-case. Property values should be strings (if | 2008 | 2006 | they are not they will be coerced to strings) or an Array of strings (in order | 2009 | 2007 | to send more than one value per header field). | 2010 | 2008 |
| 2011 | | -For example: | 2012 | | - | 2013 | 2009 | ```js | 2014 | 2010 | const headers = { | 2015 | 2011 | ':status': '200', | |
Collapse file Copy file name to clipboardExpand all lines: doc/api/modules.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -729,7 +729,7 @@ exports = { hello: false }; // Not exported, only available in the module | 729 | 729 | ``` | 730 | 730 |
| 731 | 731 | When the `module.exports` property is being completely replaced by a new | 732 | | -object, it is common to also reassign `exports`, for example: | | 732 | +object, it is common to also reassign `exports`: | 733 | 733 |
| 734 | 734 | <!-- eslint-disable func-name-matching --> | 735 | 735 | ```js | |
|