Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 3.129.20.62
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
nodejs-doc /
api /
[ HOME SHELL ]
Name
Size
Permission
Action
assets
[ DIR ]
drwxr-xr-x
addons.html
53.67
KB
-rw-r--r--
addons.md.gz
9.8
KB
-rw-r--r--
all.html
3.13
MB
-rw-r--r--
assert.html
69.81
KB
-rw-r--r--
assert.md.gz
8.17
KB
-rw-r--r--
async_hooks.html
45.55
KB
-rw-r--r--
async_hooks.md.gz
8.19
KB
-rw-r--r--
buffer.html
157.61
KB
-rw-r--r--
buffer.md.gz
16.99
KB
-rw-r--r--
child_process.html
111.13
KB
-rw-r--r--
child_process.md.gz
13.71
KB
-rw-r--r--
cli.html
47.44
KB
-rw-r--r--
cli.md.gz
7.5
KB
-rw-r--r--
cluster.html
46.91
KB
-rw-r--r--
cluster.md.gz
7.48
KB
-rw-r--r--
console.html
38.66
KB
-rw-r--r--
console.md.gz
4.73
KB
-rw-r--r--
crypto.html
212.4
KB
-rw-r--r--
crypto.md.gz
20.62
KB
-rw-r--r--
debugger.html
15.25
KB
-rw-r--r--
debugger.md.gz
2.33
KB
-rw-r--r--
deprecations.html
101.97
KB
-rw-r--r--
deprecations.md.gz
11.03
KB
-rw-r--r--
dgram.html
46.05
KB
-rw-r--r--
dgram.md.gz
6.51
KB
-rw-r--r--
dns.html
86.31
KB
-rw-r--r--
dns.md.gz
8.27
KB
-rw-r--r--
documentation.html
11.69
KB
-rw-r--r--
documentation.md
3.66
KB
-rw-r--r--
domain.html
27.43
KB
-rw-r--r--
domain.md.gz
5.45
KB
-rw-r--r--
errors.html
164.88
KB
-rw-r--r--
errors.md.gz
20.08
KB
-rw-r--r--
esm.html
17.08
KB
-rw-r--r--
esm.md.gz
2.82
KB
-rw-r--r--
events.html
43.87
KB
-rw-r--r--
events.md.gz
5.46
KB
-rw-r--r--
fs.html
330.85
KB
-rw-r--r--
fs.md.gz
28.03
KB
-rw-r--r--
globals.html
15.24
KB
-rw-r--r--
globals.md.gz
1.24
KB
-rw-r--r--
http.html
124.8
KB
-rw-r--r--
http.md.gz
17.74
KB
-rw-r--r--
http2.html
209.44
KB
-rw-r--r--
http2.md.gz
25.84
KB
-rw-r--r--
https.html
26.25
KB
-rw-r--r--
https.md.gz
3.5
KB
-rw-r--r--
index.html
8.81
KB
-rw-r--r--
index.md
1.57
KB
-rw-r--r--
inspector.html
17.34
KB
-rw-r--r--
inspector.md.gz
2.23
KB
-rw-r--r--
intl.html
20.58
KB
-rw-r--r--
intl.md.gz
3.53
KB
-rw-r--r--
modules.html
48.55
KB
-rw-r--r--
modules.md.gz
9.04
KB
-rw-r--r--
n-api.html
247.99
KB
-rw-r--r--
n-api.md.gz
32.48
KB
-rw-r--r--
net.html
82.9
KB
-rw-r--r--
net.md.gz
9.86
KB
-rw-r--r--
os.html
53.19
KB
-rw-r--r--
os.md.gz
7.37
KB
-rw-r--r--
path.html
32.74
KB
-rw-r--r--
path.md.gz
3.75
KB
-rw-r--r--
perf_hooks.html
31.93
KB
-rw-r--r--
perf_hooks.md.gz
3.18
KB
-rw-r--r--
process.html
118.78
KB
-rw-r--r--
process.md.gz
19.76
KB
-rw-r--r--
punycode.html
14.66
KB
-rw-r--r--
punycode.md.gz
1.46
KB
-rw-r--r--
querystring.html
16.92
KB
-rw-r--r--
querystring.md.gz
1.79
KB
-rw-r--r--
readline.html
39.12
KB
-rw-r--r--
readline.md.gz
5.64
KB
-rw-r--r--
repl.html
38.59
KB
-rw-r--r--
repl.md.gz
6.95
KB
-rw-r--r--
stream.html
150.27
KB
-rw-r--r--
stream.md.gz
23.02
KB
-rw-r--r--
string_decoder.html
12.16
KB
-rw-r--r--
string_decoder.md
2.75
KB
-rw-r--r--
synopsis.html
9.93
KB
-rw-r--r--
synopsis.md
2.69
KB
-rw-r--r--
timers.html
22.62
KB
-rw-r--r--
timers.md.gz
2.48
KB
-rw-r--r--
tls.html
106.34
KB
-rw-r--r--
tls.md.gz
17.93
KB
-rw-r--r--
tracing.html
16.44
KB
-rw-r--r--
tracing.md.gz
2.03
KB
-rw-r--r--
tty.html
20.34
KB
-rw-r--r--
tty.md.gz
2.39
KB
-rw-r--r--
url.html
76.68
KB
-rw-r--r--
url.md.gz
10.63
KB
-rw-r--r--
util.html
128.5
KB
-rw-r--r--
util.md.gz
13.97
KB
-rw-r--r--
v8.html
33.74
KB
-rw-r--r--
v8.md.gz
3.86
KB
-rw-r--r--
vm.html
72.43
KB
-rw-r--r--
vm.md.gz
9.85
KB
-rw-r--r--
worker_threads.html
35.04
KB
-rw-r--r--
worker_threads.md.gz
5.06
KB
-rw-r--r--
zlib.html
74.5
KB
-rw-r--r--
zlib.md.gz
7.2
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : v8.html
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>V8 | Node.js v10.19.0 Documentation</title> <link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/sh.css"> <link rel="canonical" href="v8.html"> </head> <body class="alt apidoc" id="api-section-v8"> <div id="content" class="clearfix"> <div id="column2" class="interior"> <div id="intro" class="interior"> <a href="/" title="Go back to the home page"> Node.js </a> </div> <ul> <li><a class="nav-documentation" href="documentation.html">About these Docs</a></li> <li><a class="nav-synopsis" href="synopsis.html">Usage & Example</a></li> </ul> <div class="line"></div> <ul> <li><a class="nav-assert" href="assert.html">Assertion Testing</a></li> <li><a class="nav-async_hooks" href="async_hooks.html">Async Hooks</a></li> <li><a class="nav-buffer" href="buffer.html">Buffer</a></li> <li><a class="nav-addons" href="addons.html">C++ Addons</a></li> <li><a class="nav-n-api" href="n-api.html">C/C++ Addons - N-API</a></li> <li><a class="nav-child_process" href="child_process.html">Child Processes</a></li> <li><a class="nav-cluster" href="cluster.html">Cluster</a></li> <li><a class="nav-cli" href="cli.html">Command Line Options</a></li> <li><a class="nav-console" href="console.html">Console</a></li> <li><a class="nav-crypto" href="crypto.html">Crypto</a></li> <li><a class="nav-debugger" href="debugger.html">Debugger</a></li> <li><a class="nav-deprecations" href="deprecations.html">Deprecated APIs</a></li> <li><a class="nav-dns" href="dns.html">DNS</a></li> <li><a class="nav-domain" href="domain.html">Domain</a></li> <li><a class="nav-esm" href="esm.html">ECMAScript Modules</a></li> <li><a class="nav-errors" href="errors.html">Errors</a></li> <li><a class="nav-events" href="events.html">Events</a></li> <li><a class="nav-fs" href="fs.html">File System</a></li> <li><a class="nav-globals" href="globals.html">Globals</a></li> <li><a class="nav-http" href="http.html">HTTP</a></li> <li><a class="nav-http2" href="http2.html">HTTP/2</a></li> <li><a class="nav-https" href="https.html">HTTPS</a></li> <li><a class="nav-inspector" href="inspector.html">Inspector</a></li> <li><a class="nav-intl" href="intl.html">Internationalization</a></li> <li><a class="nav-modules" href="modules.html">Modules</a></li> <li><a class="nav-net" href="net.html">Net</a></li> <li><a class="nav-os" href="os.html">OS</a></li> <li><a class="nav-path" href="path.html">Path</a></li> <li><a class="nav-perf_hooks" href="perf_hooks.html">Performance Hooks</a></li> <li><a class="nav-process" href="process.html">Process</a></li> <li><a class="nav-punycode" href="punycode.html">Punycode</a></li> <li><a class="nav-querystring" href="querystring.html">Query Strings</a></li> <li><a class="nav-readline" href="readline.html">Readline</a></li> <li><a class="nav-repl" href="repl.html">REPL</a></li> <li><a class="nav-stream" href="stream.html">Stream</a></li> <li><a class="nav-string_decoder" href="string_decoder.html">String Decoder</a></li> <li><a class="nav-timers" href="timers.html">Timers</a></li> <li><a class="nav-tls" href="tls.html">TLS/SSL</a></li> <li><a class="nav-tracing" href="tracing.html">Trace Events</a></li> <li><a class="nav-tty" href="tty.html">TTY</a></li> <li><a class="nav-dgram" href="dgram.html">UDP/Datagram</a></li> <li><a class="nav-url" href="url.html">URL</a></li> <li><a class="nav-util" href="util.html">Utilities</a></li> <li><a class="nav-v8 active" href="v8.html">V8</a></li> <li><a class="nav-vm" href="vm.html">VM</a></li> <li><a class="nav-worker_threads" href="worker_threads.html">Worker Threads</a></li> <li><a class="nav-zlib" href="zlib.html">Zlib</a></li> </ul> <div class="line"></div> <ul> <li><a class="nav-https-github-com-nodejs-node" href="https://github.com/nodejs/node">GitHub Repo & Issue Tracker</a></li> </ul> </div> <div id="column1" data-id="v8" class="interior"> <header> <h1>Node.js v10.19.0 Documentation</h1> <div id="gtoc"> <ul> <li> <a href="index.html" name="toc">Index</a> </li> <li> <a href="all.html">View on single page</a> </li> <li> <a href="v8.json">View as JSON</a> </li> <li class="version-picker"> <a href="#">View another version <span>▼</span></a> <ol class="version-picker"><li><a href="https://nodejs.org/docs/latest-v12.x/api/v8.html">12.x</a></li> <li><a href="https://nodejs.org/docs/latest-v11.x/api/v8.html">11.x</a></li> <li><a href="https://nodejs.org/docs/latest-v10.x/api/v8.html">10.x <b>LTS</b></a></li> <li><a href="https://nodejs.org/docs/latest-v9.x/api/v8.html">9.x</a></li> <li><a href="https://nodejs.org/docs/latest-v8.x/api/v8.html">8.x <b>LTS</b></a></li> <li><a href="https://nodejs.org/docs/latest-v7.x/api/v8.html">7.x</a></li> <li><a href="https://nodejs.org/docs/latest-v6.x/api/v8.html">6.x</a></li> <li><a href="https://nodejs.org/docs/latest-v5.x/api/v8.html">5.x</a></li> <li><a href="https://nodejs.org/docs/latest-v4.x/api/v8.html">4.x</a></li></ol> </li> <li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/master/doc/api/v8.md"><span class="github_icon"><svg height="16" width="16" viewBox="0 0 16.1 16.1" fill="currentColor"><path d="M8 0a8 8 0 0 0-2.5 15.6c.4 0 .5-.2.5-.4v-1.5c-2 .4-2.5-.5-2.7-1 0-.1-.5-.9-.8-1-.3-.2-.7-.6 0-.6.6 0 1 .6 1.2.8.7 1.2 1.9 1 2.4.7 0-.5.2-.9.5-1-1.8-.3-3.7-1-3.7-4 0-.9.3-1.6.8-2.2 0-.2-.3-1 .1-2 0 0 .7-.3 2.2.7a7.4 7.4 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.5 1.1.2 2 .1 2.1.5.6.8 1.3.8 2.2 0 3-1.9 3.7-3.6 4 .3.2.5.7.5 1.4v2.2c0 .2.1.5.5.4A8 8 0 0 0 16 8a8 8 0 0 0-8-8z"/></svg></span>Edit on GitHub</a></li> </ul> </div> <hr> </header> <div id="toc"> <h2>Table of Contents</h2> <ul> <li><a href="#v8_v8">V8</a><ul> <li><a href="#v8_v8_cacheddataversiontag">v8.cachedDataVersionTag()</a></li> <li><a href="#v8_v8_getheapspacestatistics">v8.getHeapSpaceStatistics()</a></li> <li><a href="#v8_v8_getheapstatistics">v8.getHeapStatistics()</a></li> <li><a href="#v8_v8_setflagsfromstring_flags">v8.setFlagsFromString(flags)</a></li> <li><span class="stability_1"><a href="#v8_serialization_api">Serialization API</a></span><ul> <li><a href="#v8_v8_serialize_value">v8.serialize(value)</a></li> <li><a href="#v8_v8_deserialize_buffer">v8.deserialize(buffer)</a></li> <li><a href="#v8_class_v8_serializer">class: v8.Serializer</a><ul> <li><a href="#v8_new_serializer">new Serializer()</a></li> <li><a href="#v8_serializer_writeheader">serializer.writeHeader()</a></li> <li><a href="#v8_serializer_writevalue_value">serializer.writeValue(value)</a></li> <li><a href="#v8_serializer_releasebuffer">serializer.releaseBuffer()</a></li> <li><a href="#v8_serializer_transferarraybuffer_id_arraybuffer">serializer.transferArrayBuffer(id, arrayBuffer)</a></li> <li><a href="#v8_serializer_writeuint32_value">serializer.writeUint32(value)</a></li> <li><a href="#v8_serializer_writeuint64_hi_lo">serializer.writeUint64(hi, lo)</a></li> <li><a href="#v8_serializer_writedouble_value">serializer.writeDouble(value)</a></li> <li><a href="#v8_serializer_writerawbytes_buffer">serializer.writeRawBytes(buffer)</a></li> <li><a href="#v8_serializer_writehostobject_object">serializer._writeHostObject(object)</a></li> <li><a href="#v8_serializer_getdatacloneerror_message">serializer._getDataCloneError(message)</a></li> <li><a href="#v8_serializer_getsharedarraybufferid_sharedarraybuffer">serializer._getSharedArrayBufferId(sharedArrayBuffer)</a></li> <li><a href="#v8_serializer_settreatarraybufferviewsashostobjects_flag">serializer._setTreatArrayBufferViewsAsHostObjects(flag)</a></li> </ul> </li> <li><a href="#v8_class_v8_deserializer">class: v8.Deserializer</a><ul> <li><a href="#v8_new_deserializer_buffer">new Deserializer(buffer)</a></li> <li><a href="#v8_deserializer_readheader">deserializer.readHeader()</a></li> <li><a href="#v8_deserializer_readvalue">deserializer.readValue()</a></li> <li><a href="#v8_deserializer_transferarraybuffer_id_arraybuffer">deserializer.transferArrayBuffer(id, arrayBuffer)</a></li> <li><a href="#v8_deserializer_getwireformatversion">deserializer.getWireFormatVersion()</a></li> <li><a href="#v8_deserializer_readuint32">deserializer.readUint32()</a></li> <li><a href="#v8_deserializer_readuint64">deserializer.readUint64()</a></li> <li><a href="#v8_deserializer_readdouble">deserializer.readDouble()</a></li> <li><a href="#v8_deserializer_readrawbytes_length">deserializer.readRawBytes(length)</a></li> <li><a href="#v8_deserializer_readhostobject">deserializer._readHostObject()</a></li> </ul> </li> <li><a href="#v8_class_v8_defaultserializer">class: v8.DefaultSerializer</a></li> <li><a href="#v8_class_v8_defaultdeserializer">class: v8.DefaultDeserializer</a></li> </ul> </li> </ul> </li> </ul> </div> <div id="apicontent"> <h1>V8<span><a class="mark" href="#v8_v8" id="v8_v8">#</a></span></h1> <!--introduced_in=v4.0.0--> <p>The <code>v8</code> module exposes APIs that are specific to the version of <a href="https://developers.google.com/v8/">V8</a> built into the Node.js binary. It can be accessed using:</p> <pre><code class="language-js">const v8 = require('v8');</code></pre> <p>The APIs and implementation are subject to change at any time.</p> <h2>v8.cachedDataVersionTag()<span><a class="mark" href="#v8_v8_cacheddataversiontag" id="v8_v8_cacheddataversiontag">#</a></span></h2> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> </ul> <p>Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features. This is useful for determining whether a <a href="vm.html#vm_new_vm_script_code_options"><code>vm.Script</code></a> <code>cachedData</code> buffer is compatible with this instance of V8.</p> <h2>v8.getHeapSpaceStatistics()<span><a class="mark" href="#v8_v8_getheapspacestatistics" id="v8_v8_getheapspacestatistics">#</a></span></h2> <div class="api_metadata"> <details class="changelog"><summary>History</summary> <table> <tr><th>Version</th><th>Changes</th></tr> <tr><td>v7.5.0</td> <td><p>Support values exceeding the 32-bit unsigned integer range.</p> </td></tr> <tr><td>v6.0.0</td> <td><p><span>Added in: v6.0.0</span></p> </td></tr> </table> </details> </div><ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object[]></a></li> </ul> <p>Returns statistics about the V8 heap spaces, i.e. the segments which make up the V8 heap. Neither the ordering of heap spaces, nor the availability of a heap space can be guaranteed as the statistics are provided via the V8 <a href="https://v8docs.nodesource.com/node-10.6/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4"><code>GetHeapSpaceStatistics</code></a> function and may change from one V8 version to the next.</p> <p>The value returned is an array of objects containing the following properties:</p> <ul> <li><code>space_name</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li> <li><code>space_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>space_used_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>space_available_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>physical_space_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> </ul> <pre><code class="language-json">[ { "space_name": "new_space", "space_size": 2063872, "space_used_size": 951112, "space_available_size": 80824, "physical_space_size": 2063872 }, { "space_name": "old_space", "space_size": 3090560, "space_used_size": 2493792, "space_available_size": 0, "physical_space_size": 3090560 }, { "space_name": "code_space", "space_size": 1260160, "space_used_size": 644256, "space_available_size": 960, "physical_space_size": 1260160 }, { "space_name": "map_space", "space_size": 1094160, "space_used_size": 201608, "space_available_size": 0, "physical_space_size": 1094160 }, { "space_name": "large_object_space", "space_size": 0, "space_used_size": 0, "space_available_size": 1490980608, "physical_space_size": 0 } ]</code></pre> <h2>v8.getHeapStatistics()<span><a class="mark" href="#v8_v8_getheapstatistics" id="v8_v8_getheapstatistics">#</a></span></h2> <div class="api_metadata"> <details class="changelog"><summary>History</summary> <table> <tr><th>Version</th><th>Changes</th></tr> <tr><td>v7.5.0</td> <td><p>Support values exceeding the 32-bit unsigned integer range.</p> </td></tr> <tr><td>v7.2.0</td> <td><p>Added <code>malloced_memory</code>, <code>peak_malloced_memory</code>, and <code>does_zap_garbage</code>.</p> </td></tr> <tr><td>v1.0.0</td> <td><p><span>Added in: v1.0.0</span></p> </td></tr> </table> </details> </div><ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></li> </ul> <p>Returns an object with the following properties:</p> <ul> <li><code>total_heap_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>total_heap_size_executable</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>total_physical_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>total_available_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>used_heap_size</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>heap_size_limit</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>malloced_memory</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>peak_malloced_memory</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> <li><code>does_zap_garbage</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> </ul> <p><code>does_zap_garbage</code> is a 0/1 boolean, which signifies whether the <code>--zap_code_space</code> option is enabled or not. This makes V8 overwrite heap garbage with a bit pattern. The RSS footprint (resident memory set) gets bigger because it continuously touches all heap pages and that makes them less likely to get swapped out by the operating system.</p> <!-- eslint-skip --> <pre><code class="language-js">{ total_heap_size: 7326976, total_heap_size_executable: 4194304, total_physical_size: 7326976, total_available_size: 1152656, used_heap_size: 3476208, heap_size_limit: 1535115264, malloced_memory: 16384, peak_malloced_memory: 1127496, does_zap_garbage: 0 }</code></pre> <h2>v8.setFlagsFromString(flags)<span><a class="mark" href="#v8_v8_setflagsfromstring_flags" id="v8_v8_setflagsfromstring_flags">#</a></span></h2> <div class="api_metadata"> <span>Added in: v1.0.0</span> </div><ul> <li><code>flags</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li> </ul> <p>The <code>v8.setFlagsFromString()</code> method can be used to programmatically set V8 command line flags. This method should be used with care. Changing settings after the VM has started may result in unpredictable behavior, including crashes and data loss; or it may simply do nothing.</p> <p>The V8 options available for a version of Node.js may be determined by running <code>node --v8-options</code>. An unofficial, community-maintained list of options and their effects is available <a href="https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md">here</a>.</p> <p>Usage:</p> <pre><code class="language-js">// Print GC events to stdout for one minute. const v8 = require('v8'); v8.setFlagsFromString('--trace_gc'); setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);</code></pre> <h2>Serialization API<span><a class="mark" href="#v8_serialization_api" id="v8_serialization_api">#</a></span></h2> <div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p>The serialization API provides means of serializing JavaScript values in a way that is compatible with the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm">HTML structured clone algorithm</a>. The format is backward-compatible (i.e. safe to store to disk).</p> <p>This API is under development, and changes (including incompatible changes to the API or wire format) may occur until this warning is removed.</p> <h3>v8.serialize(value)<span><a class="mark" href="#v8_v8_serialize_value" id="v8_v8_serialize_value">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><ul> <li><code>value</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types" class="type"><any></a></li> <li>Returns: <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a></li> </ul> <p>Uses a <a href="#v8_class_v8_defaultserializer"><code>DefaultSerializer</code></a> to serialize <code>value</code> into a buffer.</p> <h3>v8.deserialize(buffer)<span><a class="mark" href="#v8_v8_deserialize_buffer" id="v8_v8_deserialize_buffer">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><ul> <li><code>buffer</code> <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray" class="type"><TypedArray></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView" class="type"><DataView></a> A buffer returned by <a href="#v8_v8_serialize_value"><code>serialize()</code></a>.</li> </ul> <p>Uses a <a href="#v8_class_v8_defaultdeserializer"><code>DefaultDeserializer</code></a> with default options to read a JS value from a buffer.</p> <h3>class: v8.Serializer<span><a class="mark" href="#v8_class_v8_serializer" id="v8_class_v8_serializer">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><h4>new Serializer()<span><a class="mark" href="#v8_new_serializer" id="v8_new_serializer">#</a></span></h4> <p>Creates a new <code>Serializer</code> object.</p> <h4>serializer.writeHeader()<span><a class="mark" href="#v8_serializer_writeheader" id="v8_serializer_writeheader">#</a></span></h4> <p>Writes out a header, which includes the serialization format version.</p> <h4>serializer.writeValue(value)<span><a class="mark" href="#v8_serializer_writevalue_value" id="v8_serializer_writevalue_value">#</a></span></h4> <ul> <li><code>value</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types" class="type"><any></a></li> </ul> <p>Serializes a JavaScript value and adds the serialized representation to the internal buffer.</p> <p>This throws an error if <code>value</code> cannot be serialized.</p> <h4>serializer.releaseBuffer()<span><a class="mark" href="#v8_serializer_releasebuffer" id="v8_serializer_releasebuffer">#</a></span></h4> <ul> <li>Returns: <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a></li> </ul> <p>Returns the stored internal buffer. This serializer should not be used once the buffer is released. Calling this method results in undefined behavior if a previous write has failed.</p> <h4>serializer.transferArrayBuffer(id, arrayBuffer)<span><a class="mark" href="#v8_serializer_transferarraybuffer_id_arraybuffer" id="v8_serializer_transferarraybuffer_id_arraybuffer">#</a></span></h4> <ul> <li><code>id</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a> A 32-bit unsigned integer.</li> <li><code>arrayBuffer</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer" class="type"><ArrayBuffer></a> An <code>ArrayBuffer</code> instance.</li> </ul> <p>Marks an <code>ArrayBuffer</code> as havings its contents transferred out of band. Pass the corresponding <code>ArrayBuffer</code> in the deserializing context to <a href="#v8_deserializer_transferarraybuffer_id_arraybuffer"><code>deserializer.transferArrayBuffer()</code></a>.</p> <h4>serializer.writeUint32(value)<span><a class="mark" href="#v8_serializer_writeuint32_value" id="v8_serializer_writeuint32_value">#</a></span></h4> <ul> <li><code>value</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> </ul> <p>Write a raw 32-bit unsigned integer. For use inside of a custom <a href="#v8_serializer_writehostobject_object"><code>serializer._writeHostObject()</code></a>.</p> <h4>serializer.writeUint64(hi, lo)<span><a class="mark" href="#v8_serializer_writeuint64_hi_lo" id="v8_serializer_writeuint64_hi_lo">#</a></span></h4> <ul> <li><code>hi</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> <li><code>lo</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> </ul> <p>Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. For use inside of a custom <a href="#v8_serializer_writehostobject_object"><code>serializer._writeHostObject()</code></a>.</p> <h4>serializer.writeDouble(value)<span><a class="mark" href="#v8_serializer_writedouble_value" id="v8_serializer_writedouble_value">#</a></span></h4> <ul> <li><code>value</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> </ul> <p>Write a JS <code>number</code> value. For use inside of a custom <a href="#v8_serializer_writehostobject_object"><code>serializer._writeHostObject()</code></a>.</p> <h4>serializer.writeRawBytes(buffer)<span><a class="mark" href="#v8_serializer_writerawbytes_buffer" id="v8_serializer_writerawbytes_buffer">#</a></span></h4> <ul> <li><code>buffer</code> <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray" class="type"><TypedArray></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView" class="type"><DataView></a></li> </ul> <p>Write raw bytes into the serializer’s internal buffer. The deserializer will require a way to compute the length of the buffer. For use inside of a custom <a href="#v8_serializer_writehostobject_object"><code>serializer._writeHostObject()</code></a>.</p> <h4>serializer._writeHostObject(object)<span><a class="mark" href="#v8_serializer_writehostobject_object" id="v8_serializer_writehostobject_object">#</a></span></h4> <ul> <li><code>object</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></li> </ul> <p>This method is called to write some kind of host object, i.e. an object created by native C++ bindings. If it is not possible to serialize <code>object</code>, a suitable exception should be thrown.</p> <p>This method is not present on the <code>Serializer</code> class itself but can be provided by subclasses.</p> <h4>serializer._getDataCloneError(message)<span><a class="mark" href="#v8_serializer_getdatacloneerror_message" id="v8_serializer_getdatacloneerror_message">#</a></span></h4> <ul> <li><code>message</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li> </ul> <p>This method is called to generate error objects that will be thrown when an object can not be cloned.</p> <p>This method defaults to the <a href="errors.html#errors_class_error"><code>Error</code></a> constructor and can be overridden on subclasses.</p> <h4>serializer._getSharedArrayBufferId(sharedArrayBuffer)<span><a class="mark" href="#v8_serializer_getsharedarraybufferid_sharedarraybuffer" id="v8_serializer_getsharedarraybufferid_sharedarraybuffer">#</a></span></h4> <ul> <li><code>sharedArrayBuffer</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer" class="type"><SharedArrayBuffer></a></li> </ul> <p>This method is called when the serializer is going to serialize a <code>SharedArrayBuffer</code> object. It must return an unsigned 32-bit integer ID for the object, using the same ID if this <code>SharedArrayBuffer</code> has already been serialized. When deserializing, this ID will be passed to <a href="#v8_deserializer_transferarraybuffer_id_arraybuffer"><code>deserializer.transferArrayBuffer()</code></a>.</p> <p>If the object cannot be serialized, an exception should be thrown.</p> <p>This method is not present on the <code>Serializer</code> class itself but can be provided by subclasses.</p> <h4>serializer._setTreatArrayBufferViewsAsHostObjects(flag)<span><a class="mark" href="#v8_serializer_settreatarraybufferviewsashostobjects_flag" id="v8_serializer_settreatarraybufferviewsashostobjects_flag">#</a></span></h4> <ul> <li><code>flag</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type" class="type"><boolean></a> <strong>Default:</strong> <code>false</code></li> </ul> <p>Indicate whether to treat <code>TypedArray</code> and <code>DataView</code> objects as host objects, i.e. pass them to <a href="#v8_serializer_writehostobject_object"><code>serializer._writeHostObject()</code></a>.</p> <h3>class: v8.Deserializer<span><a class="mark" href="#v8_class_v8_deserializer" id="v8_class_v8_deserializer">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><h4>new Deserializer(buffer)<span><a class="mark" href="#v8_new_deserializer_buffer" id="v8_new_deserializer_buffer">#</a></span></h4> <ul> <li><code>buffer</code> <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray" class="type"><TypedArray></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView" class="type"><DataView></a> A buffer returned by <a href="#v8_serializer_releasebuffer"><code>serializer.releaseBuffer()</code></a>.</li> </ul> <p>Creates a new <code>Deserializer</code> object.</p> <h4>deserializer.readHeader()<span><a class="mark" href="#v8_deserializer_readheader" id="v8_deserializer_readheader">#</a></span></h4> <p>Reads and validates a header (including the format version). May, for example, reject an invalid or unsupported wire format. In that case, an <code>Error</code> is thrown.</p> <h4>deserializer.readValue()<span><a class="mark" href="#v8_deserializer_readvalue" id="v8_deserializer_readvalue">#</a></span></h4> <p>Deserializes a JavaScript value from the buffer and returns it.</p> <h4>deserializer.transferArrayBuffer(id, arrayBuffer)<span><a class="mark" href="#v8_deserializer_transferarraybuffer_id_arraybuffer" id="v8_deserializer_transferarraybuffer_id_arraybuffer">#</a></span></h4> <ul> <li><code>id</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a> A 32-bit unsigned integer.</li> <li><code>arrayBuffer</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer" class="type"><ArrayBuffer></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer" class="type"><SharedArrayBuffer></a> An <code>ArrayBuffer</code> instance.</li> </ul> <p>Marks an <code>ArrayBuffer</code> as havings its contents transferred out of band. Pass the corresponding <code>ArrayBuffer</code> in the serializing context to <a href="#v8_serializer_transferarraybuffer_id_arraybuffer"><code>serializer.transferArrayBuffer()</code></a> (or return the <code>id</code> from <a href="#v8_serializer_getsharedarraybufferid_sharedarraybuffer"><code>serializer._getSharedArrayBufferId()</code></a> in the case of <code>SharedArrayBuffer</code>s).</p> <h4>deserializer.getWireFormatVersion()<span><a class="mark" href="#v8_deserializer_getwireformatversion" id="v8_deserializer_getwireformatversion">#</a></span></h4> <ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> </ul> <p>Reads the underlying wire format version. Likely mostly to be useful to legacy code reading old wire format versions. May not be called before <code>.readHeader()</code>.</p> <h4>deserializer.readUint32()<span><a class="mark" href="#v8_deserializer_readuint32" id="v8_deserializer_readuint32">#</a></span></h4> <ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> </ul> <p>Read a raw 32-bit unsigned integer and return it. For use inside of a custom <a href="#v8_deserializer_readhostobject"><code>deserializer._readHostObject()</code></a>.</p> <h4>deserializer.readUint64()<span><a class="mark" href="#v8_deserializer_readuint64" id="v8_deserializer_readuint64">#</a></span></h4> <ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer[]></a></li> </ul> <p>Read a raw 64-bit unsigned integer and return it as an array <code>[hi, lo]</code> with two 32-bit unsigned integer entries. For use inside of a custom <a href="#v8_deserializer_readhostobject"><code>deserializer._readHostObject()</code></a>.</p> <h4>deserializer.readDouble()<span><a class="mark" href="#v8_deserializer_readdouble" id="v8_deserializer_readdouble">#</a></span></h4> <ul> <li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a></li> </ul> <p>Read a JS <code>number</code> value. For use inside of a custom <a href="#v8_deserializer_readhostobject"><code>deserializer._readHostObject()</code></a>.</p> <h4>deserializer.readRawBytes(length)<span><a class="mark" href="#v8_deserializer_readrawbytes_length" id="v8_deserializer_readrawbytes_length">#</a></span></h4> <ul> <li><code>length</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li> <li>Returns: <a href="buffer.html#buffer_class_buffer" class="type"><Buffer></a></li> </ul> <p>Read raw bytes from the deserializer’s internal buffer. The <code>length</code> parameter must correspond to the length of the buffer that was passed to <a href="#v8_serializer_writerawbytes_buffer"><code>serializer.writeRawBytes()</code></a>. For use inside of a custom <a href="#v8_deserializer_readhostobject"><code>deserializer._readHostObject()</code></a>.</p> <h4>deserializer._readHostObject()<span><a class="mark" href="#v8_deserializer_readhostobject" id="v8_deserializer_readhostobject">#</a></span></h4> <p>This method is called to read some kind of host object, i.e. an object that is created by native C++ bindings. If it is not possible to deserialize the data, a suitable exception should be thrown.</p> <p>This method is not present on the <code>Deserializer</code> class itself but can be provided by subclasses.</p> <h3>class: v8.DefaultSerializer<span><a class="mark" href="#v8_class_v8_defaultserializer" id="v8_class_v8_defaultserializer">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><p>A subclass of <a href="#v8_class_v8_serializer"><code>Serializer</code></a> that serializes <code>TypedArray</code> (in particular <a href="buffer.html"><code>Buffer</code></a>) and <code>DataView</code> objects as host objects, and only stores the part of their underlying <code>ArrayBuffer</code>s that they are referring to.</p> <h3>class: v8.DefaultDeserializer<span><a class="mark" href="#v8_class_v8_defaultdeserializer" id="v8_class_v8_defaultdeserializer">#</a></span></h3> <div class="api_metadata"> <span>Added in: v8.0.0</span> </div><p>A subclass of <a href="#v8_class_v8_deserializer"><code>Deserializer</code></a> corresponding to the format written by <a href="#v8_class_v8_defaultserializer"><code>DefaultSerializer</code></a>.</p> </div> </div> </div> <script src="assets/sh_main.js"></script> <script src="assets/sh_javascript.min.js"></script> <script>highlight(undefined, undefined, 'pre');</script> </body> </html>
Close