diff options
author | Rich Trott <rtrott@gmail.com> | 2020-10-28 16:58:45 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-11-06 15:59:31 +0300 |
commit | ec400f80564117e7912ee75f16327f9fdb1cdd9d (patch) | |
tree | 51bb10e96db3e0b51c34dc82f6e11f38483be32f /doc/api/v8.md | |
parent | 456b4e133c16215ed9e2a98666223507d19a18eb (diff) |
doc: revise v8.getHeapSnapshot()
* move entry above v8.getHeapSpaceStatistics() (where it belongs
alphabetically and is not out of place logically)
* split lengthy sentence into two sentences
PR-URL: https://github.com/nodejs/node/pull/35849
Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'doc/api/v8.md')
-rw-r--r-- | doc/api/v8.md | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/doc/api/v8.md b/doc/api/v8.md index 0dc8eddc3dc..aad3c77b947 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -32,6 +32,26 @@ v8.setFlagsFromString('--allow_natives_syntax'); console.log(v8.cachedDataVersionTag()); // 183726201 ``` +## `v8.getHeapSnapshot()` +<!-- YAML +added: v11.13.0 +--> + +* Returns: {stream.Readable} A Readable Stream containing the V8 heap snapshot + +Generates a snapshot of the current V8 heap and returns a Readable +Stream that may be used to read the JSON serialized representation. +This JSON stream format is intended to be used with tools such as +Chrome DevTools. The JSON schema is undocumented and specific to the +V8 engine. Therefore, the schema may change from one version of V8 to the next. + +```js +// Print heap snapshot to the console +const v8 = require('v8'); +const stream = v8.getHeapSnapshot(); +stream.pipe(process.stdout); +``` + ## `v8.getHeapSpaceStatistics()` <!-- YAML added: v6.0.0 @@ -97,26 +117,6 @@ The value returned is an array of objects containing the following properties: ] ``` -## `v8.getHeapSnapshot()` -<!-- YAML -added: v11.13.0 ---> - -* Returns: {stream.Readable} A Readable Stream containing the V8 heap snapshot - -Generates a snapshot of the current V8 heap and returns a Readable -Stream that may be used to read the JSON serialized representation. -This JSON stream format is intended to be used with tools such as -Chrome DevTools. The JSON schema is undocumented and specific to the -V8 engine, and may change from one version of V8 to the next. - -```js -// Print heap snapshot to the console -const v8 = require('v8'); -const stream = v8.getHeapSnapshot(); -stream.pipe(process.stdout); -``` - ## `v8.getHeapStatistics()` <!-- YAML added: v1.0.0 |