| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 827f843 commit 9c247c5
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,8 +65,16 @@ | |||
| 65 | 65 | * Make the "Note:" label italic, i.e. `*Note*:`. | |
| 66 | 66 | * Use a capital letter after the "Note:" label. | |
| 67 | 67 | * Preferably, make the note a new paragraph for better visual distinction. | |
| 68 | + * Function arguments or object properties should use the following format: | ||
| 69 | + * <code>* \`name\` {type|type2} Optional description. \*\*Default:\*\* \`defaultValue\`</code> | ||
| 70 | + * E.g. <code>* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`</code> | ||
| 71 | + * The `type` should refer to a Node.js type or a [JavaScript type][] | ||
| 72 | + * Function returns should use the following format: | ||
| 73 | + * <code>* Returns: {type|type2} Optional description.</code> | ||
| 74 | + * E.g. <code>* Returns: {AsyncHook} A reference to `asyncHook`.</code> | ||
| 68 | 75 | ||
| 69 | - [plugin]: http://editorconfig.org/#download | ||
| 70 | - [Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma | ||
| 71 | 76 | [Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash | |
| 77 | + [Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types | ||
| 78 | + [Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma | ||
| 72 | 79 | [The New York Times Manual of Style and Usage]: https://en.wikipedia.org/wiki/The_New_York_Times_Manual_of_Style_and_Usage | |
| 80 | + [plugin]: http://editorconfig.org/#download | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1060,8 +1060,8 @@ has ended but before the JavaScript VM is terminated and Node.js shuts down. | |||
| 1060 | 1060 | ||
| 1061 | 1061 | #### void AtExit(callback, args) | |
| 1062 | 1062 | ||
| 1063 | - * `callback`: `void (*)(void*)` - A pointer to the function to call at exit. | ||
| 1064 | - * `args`: `void*` - A pointer to pass to the callback at exit. | ||
| 1063 | + * `callback` {void (\*)(void\*)} A pointer to the function to call at exit. | ||
| 1064 | + * `args` {void\*} A pointer to pass to the callback at exit. | ||
| 1065 | 1065 | ||
| 1066 | 1066 | Registers exit hooks that run after the event loop has ended but before the VM | |
| 1067 | 1067 | is killed. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -275,8 +275,8 @@ added: v0.1.21 | |||
| 275 | 275 | * `actual` {any} | |
| 276 | 276 | * `expected` {any} | |
| 277 | 277 | * `message` {any} | |
| 278 | - * `operator` {string} (default: '!=') | ||
| 279 | - * `stackStartFunction` {function} (default: `assert.fail`) | ||
| 278 | + * `operator` {string} **Default:** '!=' | ||
| 279 | + * `stackStartFunction` {function} **Default:** `assert.fail` | ||
| 280 | 280 | ||
| 281 | 281 | Throws an `AssertionError`. If `message` is falsy, the error message is set as | |
| 282 | 282 | the values of `actual` and `expected` separated by the provided `operator`. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,12 +79,12 @@ function promiseResolve(asyncId) { } | |||
| 79 | 79 | added: v8.1.0 | |
| 80 | 80 | --> | |
| 81 | 81 | ||
| 82 | - * `callbacks` {Object} the [Hook Callbacks][] to register | ||
| 82 | + * `callbacks` {Object} The [Hook Callbacks][] to register | ||
| 83 | 83 | * `init` {Function} The [`init` callback][]. | |
| 84 | 84 | * `before` {Function} The [`before` callback][]. | |
| 85 | 85 | * `after` {Function} The [`after` callback][]. | |
| 86 | 86 | * `destroy` {Function} The [`destroy` callback][]. | |
| 87 | - * Returns: `{AsyncHook}` instance used for disabling and enabling hooks | ||
| 87 | + * Returns: `{AsyncHook}` Instance used for disabling and enabling hooks | ||
| 88 | 88 | ||
| 89 | 89 | Registers functions to be called for different lifetime events of each async | |
| 90 | 90 | operation. | |
@@ -168,7 +168,7 @@ doing this the otherwise infinite recursion is broken. | |||
| 168 | 168 | ||
| 169 | 169 | #### `asyncHook.enable()` | |
| 170 | 170 | ||
| 171 | - * Returns {AsyncHook} A reference to `asyncHook`. | ||
| 171 | + * Returns: {AsyncHook} A reference to `asyncHook`. | ||
| 172 | 172 | ||
| 173 | 173 | Enable the callbacks for a given `AsyncHook` instance. If no callbacks are | |
| 174 | 174 | provided enabling is a noop. | |
@@ -184,7 +184,7 @@ const hook = async_hooks.createHook(callbacks).enable(); | |||
| 184 | 184 | ||
| 185 | 185 | #### `asyncHook.disable()` | |
| 186 | 186 | ||
| 187 | - * Returns {AsyncHook} A reference to `asyncHook`. | ||
| 187 | + * Returns: {AsyncHook} A reference to `asyncHook`. | ||
| 188 | 188 | ||
| 189 | 189 | Disable the callbacks for a given `AsyncHook` instance from the global pool of | |
| 190 | 190 | AsyncHook callbacks to be executed. Once a hook has been disabled it will not | |
@@ -200,12 +200,12 @@ instance is destructed. | |||
| 200 | 200 | ||
| 201 | 201 | ##### `init(asyncId, type, triggerAsyncId, resource)` | |
| 202 | 202 | ||
| 203 | - * `asyncId` {number} a unique ID for the async resource | ||
| 204 | - * `type` {string} the type of the async resource | ||
| 205 | - * `triggerAsyncId` {number} the unique ID of the async resource in whose | ||
| 206 | - execution context this async resource was created | ||
| 207 | - * `resource` {Object} reference to the resource representing the async operation, | ||
| 208 | - needs to be released during _destroy_ | ||
| 203 | + * `asyncId` {number} A unique ID for the async resource. | ||
| 204 | + * `type` {string} The type of the async resource. | ||
| 205 | + * `triggerAsyncId` {number} The unique ID of the async resource in whose | ||
| 206 | + execution context this async resource was created. | ||
| 207 | + * `resource` {Object} Reference to the resource representing the async operation, | ||
| 208 | + needs to be released during _destroy_. | ||
| 209 | 209 | ||
| 210 | 210 | Called when a class is constructed that has the _possibility_ to emit an | |
| 211 | 211 | asynchronous event. This _does not_ mean the instance must call | |
@@ -468,7 +468,7 @@ init for PROMISE with id 6, trigger id: 5 # the Promise returned by then() | |||
| 468 | 468 | ||
| 469 | 469 | #### `async_hooks.executionAsyncId()` | |
| 470 | 470 | ||
| 471 | - * Returns {number} the `asyncId` of the current execution context. Useful to | ||
| 471 | + * Returns: {number} The `asyncId` of the current execution context. Useful to | ||
| 472 | 472 | track when something calls. | |
| 473 | 473 | ||
| 474 | 474 | For example: | |
@@ -502,7 +502,7 @@ const server = net.createServer(function onConnection(conn) { | |||
| 502 | 502 | ||
| 503 | 503 | #### `async_hooks.triggerAsyncId()` | |
| 504 | 504 | ||
| 505 | - * Returns {number} the ID of the resource responsible for calling the callback | ||
| 505 | + * Returns: {number} The ID of the resource responsible for calling the callback | ||
| 506 | 506 | that is currently being executed. | |
| 507 | 507 | ||
| 508 | 508 | For example: | |
@@ -569,9 +569,9 @@ asyncResource.triggerAsyncId(); | |||
| 569 | 569 | #### `AsyncResource(type[, triggerAsyncId])` | |
| 570 | 570 | ||
| 571 | 571 | * arguments | |
| 572 | - * `type` {string} the type of async event | ||
| 573 | - * `triggerAsyncId` {number} the ID of the execution context that created this | ||
| 574 | - async event | ||
| 572 | + * `type` {string} The type of async event. | ||
| 573 | + * `triggerAsyncId` {number} The ID of the execution context that created this | ||
| 574 | + async event. | ||
| 575 | 575 | ||
| 576 | 576 | Example usage: | |
| 577 | 577 | ||
@@ -599,15 +599,15 @@ class DBQuery extends AsyncResource { | |||
| 599 | 599 | ||
| 600 | 600 | #### `asyncResource.emitBefore()` | |
| 601 | 601 | ||
| 602 | - * Returns {undefined} | ||
| 602 | + * Returns: {undefined} | ||
| 603 | 603 | ||
| 604 | 604 | Call all `before` callbacks to notify that a new asynchronous execution context | |
| 605 | 605 | is being entered. If nested calls to `emitBefore()` are made, the stack of | |
| 606 | 606 | `asyncId`s will be tracked and properly unwound. | |
| 607 | 607 | ||
| 608 | 608 | #### `asyncResource.emitAfter()` | |
| 609 | 609 | ||
| 610 | - * Returns {undefined} | ||
| 610 | + * Returns: {undefined} | ||
| 611 | 611 | ||
| 612 | 612 | Call all `after` callbacks. If nested calls to `emitBefore()` were made, then | |
| 613 | 613 | make sure the stack is unwound properly. Otherwise an error will be thrown. | |
@@ -618,7 +618,7 @@ called for all `asyncId`s on the stack if the error is handled by a domain or | |||
| 618 | 618 | ||
| 619 | 619 | #### `asyncResource.emitDestroy()` | |
| 620 | 620 | ||
| 621 | - * Returns {undefined} | ||
| 621 | + * Returns: {undefined} | ||
| 622 | 622 | ||
| 623 | 623 | Call all `destroy` hooks. This should only ever be called once. An error will | |
| 624 | 624 | be thrown if it is called more than once. This **must** be manually called. If | |
@@ -627,11 +627,11 @@ never be called. | |||
| 627 | 627 | ||
| 628 | 628 | #### `asyncResource.asyncId()` | |
| 629 | 629 | ||
| 630 | - * Returns {number} the unique `asyncId` assigned to the resource. | ||
| 630 | + * Returns: {number} The unique `asyncId` assigned to the resource. | ||
| 631 | 631 | ||
| 632 | 632 | #### `asyncResource.triggerAsyncId()` | |
| 633 | 633 | ||
| 634 | - * Returns {number} the same `triggerAsyncId` that is passed to the `AsyncResource` | ||
| 634 | + * Returns: {number} The same `triggerAsyncId` that is passed to the `AsyncResource` | ||
| 635 | 635 | constructor. | |
| 636 | 636 | ||
| 637 | 637 | [`after` callback]: #async_hooks_after_asyncid | |
| Back | FazBrowse Home | New Git URL |
0 commit comments