Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.144.114.4
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
nodejs-docs-14.18.3 /
html /
api /
Delete
Unzip
Name
Size
Permission
Date
Action
assets
[ DIR ]
drwxr-xr-x
2022-01-26 16:43
addons.html
97.08
KB
-rw-r--r--
2022-01-10 13:06
addons.json
48.6
KB
-rw-r--r--
2022-01-10 13:06
addons.md
39.44
KB
-rw-r--r--
2022-01-10 13:06
all.html
5.06
MB
-rw-r--r--
2022-01-10 13:06
all.json
4.78
MB
-rw-r--r--
2022-01-10 13:06
assert.html
118.84
KB
-rw-r--r--
2022-01-10 13:06
assert.json
83.37
KB
-rw-r--r--
2022-01-10 13:06
assert.md
47.93
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.html
94.53
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.json
64.9
KB
-rw-r--r--
2022-01-10 13:06
async_hooks.md
38.62
KB
-rw-r--r--
2022-01-10 13:06
buffer.html
289.36
KB
-rw-r--r--
2022-01-10 13:06
buffer.json
227.52
KB
-rw-r--r--
2022-01-10 13:06
buffer.md
109.83
KB
-rw-r--r--
2022-01-10 13:06
child_process.html
156.96
KB
-rw-r--r--
2022-01-10 13:06
child_process.json
140.03
KB
-rw-r--r--
2022-01-10 13:06
child_process.md
69.69
KB
-rw-r--r--
2022-01-10 13:06
cli.html
99.52
KB
-rw-r--r--
2022-01-10 13:06
cli.json
97.49
KB
-rw-r--r--
2022-01-10 13:06
cli.md
47.37
KB
-rw-r--r--
2022-01-10 13:06
cluster.html
65.92
KB
-rw-r--r--
2022-01-10 13:06
cluster.json
45.84
KB
-rw-r--r--
2022-01-10 13:06
cluster.md
24.83
KB
-rw-r--r--
2022-01-10 13:06
console.html
50.57
KB
-rw-r--r--
2022-01-10 13:06
console.json
40.04
KB
-rw-r--r--
2022-01-10 13:06
console.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
crypto.html
297.2
KB
-rw-r--r--
2022-01-10 13:06
crypto.json
261.36
KB
-rw-r--r--
2022-01-10 13:06
crypto.md
124.37
KB
-rw-r--r--
2022-01-10 13:06
debugger.html
21.62
KB
-rw-r--r--
2022-01-10 13:06
debugger.json
9.75
KB
-rw-r--r--
2022-01-10 13:06
debugger.md
6.43
KB
-rw-r--r--
2022-01-10 13:06
deprecations.html
142.64
KB
-rw-r--r--
2022-01-10 13:06
deprecations.json
164.68
KB
-rw-r--r--
2022-01-10 13:06
deprecations.md
81.32
KB
-rw-r--r--
2022-01-10 13:06
dgram.html
67.09
KB
-rw-r--r--
2022-01-10 13:06
dgram.json
57.33
KB
-rw-r--r--
2022-01-10 13:06
dgram.md
27.81
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.html
21.13
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.json
10.8
KB
-rw-r--r--
2022-01-10 13:06
diagnostics_channel.md
5.24
KB
-rw-r--r--
2022-01-10 13:06
dns.html
109.72
KB
-rw-r--r--
2022-01-10 13:06
dns.json
98.84
KB
-rw-r--r--
2022-01-10 13:06
dns.md
44.29
KB
-rw-r--r--
2022-01-10 13:06
documentation.html
18.4
KB
-rw-r--r--
2022-01-10 13:06
documentation.json
8.83
KB
-rw-r--r--
2022-01-10 13:06
documentation.md
4.05
KB
-rw-r--r--
2022-01-10 13:06
domain.html
41.38
KB
-rw-r--r--
2022-01-10 13:06
domain.json
22.06
KB
-rw-r--r--
2022-01-10 13:06
domain.md
15.2
KB
-rw-r--r--
2022-01-10 13:06
embedding.html
24.65
KB
-rw-r--r--
2022-01-10 13:06
embedding.json
10.05
KB
-rw-r--r--
2022-01-10 13:06
embedding.md
8.67
KB
-rw-r--r--
2022-01-10 13:06
errors.html
189.1
KB
-rw-r--r--
2022-01-10 13:06
errors.json
194.73
KB
-rw-r--r--
2022-01-10 13:06
errors.md
82.71
KB
-rw-r--r--
2022-01-10 13:06
esm.html
97.97
KB
-rw-r--r--
2022-01-10 13:06
esm.json
78.48
KB
-rw-r--r--
2022-01-10 13:06
esm.md
48.2
KB
-rw-r--r--
2022-01-10 13:06
events.html
129.56
KB
-rw-r--r--
2022-01-10 13:06
events.json
94.12
KB
-rw-r--r--
2022-01-10 13:06
events.md
43.71
KB
-rw-r--r--
2022-01-10 13:06
fs.html
503.09
KB
-rw-r--r--
2022-01-10 13:06
fs.json
500.22
KB
-rw-r--r--
2022-01-10 13:06
fs.md
210.32
KB
-rw-r--r--
2022-01-10 13:06
globals.html
29.55
KB
-rw-r--r--
2022-01-10 13:06
globals.json
31.16
KB
-rw-r--r--
2022-01-10 13:06
globals.md
8.21
KB
-rw-r--r--
2022-01-10 13:06
http.html
213.14
KB
-rw-r--r--
2022-01-10 13:06
http.json
214.96
KB
-rw-r--r--
2022-01-10 13:06
http.md
91.28
KB
-rw-r--r--
2022-01-10 13:06
http2.html
274.7
KB
-rw-r--r--
2022-01-10 13:06
http2.json
274.23
KB
-rw-r--r--
2022-01-10 13:06
http2.md
123.62
KB
-rw-r--r--
2022-01-10 13:06
https.html
44.54
KB
-rw-r--r--
2022-01-10 13:06
https.json
36.55
KB
-rw-r--r--
2022-01-10 13:06
https.md
14.58
KB
-rw-r--r--
2022-01-10 13:06
index.html
12.21
KB
-rw-r--r--
2022-01-10 13:06
index.json
54
B
-rw-r--r--
2022-01-10 13:06
index.md
1.73
KB
-rw-r--r--
2022-01-10 13:06
inspector.html
25.57
KB
-rw-r--r--
2022-01-10 13:06
inspector.json
13.43
KB
-rw-r--r--
2022-01-10 13:06
inspector.md
6.66
KB
-rw-r--r--
2022-01-10 13:06
intl.html
25.1
KB
-rw-r--r--
2022-01-10 13:06
intl.json
14.5
KB
-rw-r--r--
2022-01-10 13:06
intl.md
10.46
KB
-rw-r--r--
2022-01-10 13:06
module.html
23.9
KB
-rw-r--r--
2022-01-10 13:06
module.json
13.29
KB
-rw-r--r--
2022-01-10 13:06
module.md
5.2
KB
-rw-r--r--
2022-01-10 13:06
modules.html
67.19
KB
-rw-r--r--
2022-01-10 13:06
modules.json
48.92
KB
-rw-r--r--
2022-01-10 13:06
modules.md
30.83
KB
-rw-r--r--
2022-01-10 13:06
n-api.html
336.63
KB
-rw-r--r--
2022-01-10 13:06
n-api.json
330.37
KB
-rw-r--r--
2022-01-10 13:06
n-api.md
206.51
KB
-rw-r--r--
2022-01-10 13:06
net.html
111.64
KB
-rw-r--r--
2022-01-10 13:06
net.json
108.87
KB
-rw-r--r--
2022-01-10 13:06
net.md
44.19
KB
-rw-r--r--
2022-01-10 13:06
os.html
60.56
KB
-rw-r--r--
2022-01-10 13:06
os.json
50.72
KB
-rw-r--r--
2022-01-10 13:06
os.md
33.98
KB
-rw-r--r--
2022-01-10 13:06
packages.html
80.39
KB
-rw-r--r--
2022-01-10 13:06
packages.json
59.35
KB
-rw-r--r--
2022-01-10 13:06
packages.md
39.1
KB
-rw-r--r--
2022-01-10 13:06
path.html
43.66
KB
-rw-r--r--
2022-01-10 13:06
path.json
27.96
KB
-rw-r--r--
2022-01-10 13:06
path.md
14.46
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.html
71.71
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.json
49.24
KB
-rw-r--r--
2022-01-10 13:06
perf_hooks.md
23.17
KB
-rw-r--r--
2022-01-10 13:06
policy.html
35.98
KB
-rw-r--r--
2022-01-10 13:06
policy.json
18.38
KB
-rw-r--r--
2022-01-10 13:06
policy.md
13.9
KB
-rw-r--r--
2022-01-10 13:06
process.html
192.69
KB
-rw-r--r--
2022-01-10 13:06
process.json
150.9
KB
-rw-r--r--
2022-01-10 13:06
process.md
86.44
KB
-rw-r--r--
2022-01-10 13:06
punycode.html
19.88
KB
-rw-r--r--
2022-01-10 13:06
punycode.json
8.79
KB
-rw-r--r--
2022-01-10 13:06
punycode.md
4.17
KB
-rw-r--r--
2022-01-10 13:06
querystring.html
22.01
KB
-rw-r--r--
2022-01-10 13:06
querystring.json
12.74
KB
-rw-r--r--
2022-01-10 13:06
querystring.md
5.48
KB
-rw-r--r--
2022-01-10 13:06
readline.html
69.79
KB
-rw-r--r--
2022-01-10 13:06
readline.json
55.74
KB
-rw-r--r--
2022-01-10 13:06
readline.md
28.04
KB
-rw-r--r--
2022-01-10 13:06
repl.html
58.19
KB
-rw-r--r--
2022-01-10 13:06
repl.json
44.5
KB
-rw-r--r--
2022-01-10 13:06
repl.md
23.61
KB
-rw-r--r--
2022-01-10 13:06
report.html
71.4
KB
-rw-r--r--
2022-01-10 13:06
report.json
21.23
KB
-rw-r--r--
2022-01-10 13:06
report.md
17.92
KB
-rw-r--r--
2022-01-10 13:06
stream.html
226.43
KB
-rw-r--r--
2022-01-10 13:06
stream.json
223.31
KB
-rw-r--r--
2022-01-10 13:06
stream.md
100.94
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.html
17.5
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.json
5.8
KB
-rw-r--r--
2022-01-10 13:06
string_decoder.md
2.94
KB
-rw-r--r--
2022-01-10 13:06
synopsis.html
13.93
KB
-rw-r--r--
2022-01-10 13:06
synopsis.json
2.97
KB
-rw-r--r--
2022-01-10 13:06
synopsis.md
2.13
KB
-rw-r--r--
2022-01-10 13:06
timers.html
32.99
KB
-rw-r--r--
2022-01-10 13:06
timers.json
23.92
KB
-rw-r--r--
2022-01-10 13:06
timers.md
10.55
KB
-rw-r--r--
2022-01-10 13:06
tls.html
152.2
KB
-rw-r--r--
2022-01-10 13:06
tls.json
161.77
KB
-rw-r--r--
2022-01-10 13:06
tls.md
81.06
KB
-rw-r--r--
2022-01-10 13:06
tracing.html
22.43
KB
-rw-r--r--
2022-01-10 13:06
tracing.json
12.14
KB
-rw-r--r--
2022-01-10 13:06
tracing.md
6.59
KB
-rw-r--r--
2022-01-10 13:06
tty.html
29.16
KB
-rw-r--r--
2022-01-10 13:06
tty.json
22.31
KB
-rw-r--r--
2022-01-10 13:06
tty.md
8.78
KB
-rw-r--r--
2022-01-10 13:06
url.html
122.38
KB
-rw-r--r--
2022-01-10 13:06
url.json
88.21
KB
-rw-r--r--
2022-01-10 13:06
url.md
49.32
KB
-rw-r--r--
2022-01-10 13:06
util.html
199.52
KB
-rw-r--r--
2022-01-10 13:06
util.json
171.18
KB
-rw-r--r--
2022-01-10 13:06
util.md
71.47
KB
-rw-r--r--
2022-01-10 13:06
v8.html
51.61
KB
-rw-r--r--
2022-01-10 13:06
v8.json
39.5
KB
-rw-r--r--
2022-01-10 13:06
v8.md
16.55
KB
-rw-r--r--
2022-01-10 13:06
vm.html
123.51
KB
-rw-r--r--
2022-01-10 13:06
vm.json
113.19
KB
-rw-r--r--
2022-01-10 13:06
vm.md
55.37
KB
-rw-r--r--
2022-01-10 13:06
wasi.html
21.16
KB
-rw-r--r--
2022-01-10 13:06
wasi.json
11.72
KB
-rw-r--r--
2022-01-10 13:06
wasi.md
6.27
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.html
90.29
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.json
69.84
KB
-rw-r--r--
2022-01-10 13:06
worker_threads.md
39
KB
-rw-r--r--
2022-01-10 13:06
zlib.html
95.09
KB
-rw-r--r--
2022-01-10 13:06
zlib.json
100.2
KB
-rw-r--r--
2022-01-10 13:06
zlib.md
35.03
KB
-rw-r--r--
2022-01-10 13:06
Save
Rename
{ "type": "module", "source": "doc/api/timers.md", "modules": [ { "textRaw": "Timers", "name": "timers", "introduced_in": "v0.10.0", "stability": 2, "stabilityText": "Stable", "desc": "<p><strong>Source Code:</strong> <a href=\"https://github.com/nodejs/node/blob/v14.18.3/lib/timers.js\">lib/timers.js</a></p>\n<p>The <code>timer</code> module exposes a global API for scheduling functions to\nbe called at some future period of time. Because the timer functions are\nglobals, there is no need to call <code>require('timers')</code> to use the API.</p>\n<p>The timer functions within Node.js implement a similar API as the timers API\nprovided by Web Browsers but use a different internal implementation that is\nbuilt around the Node.js <a href=\"https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout\">Event Loop</a>.</p>", "classes": [ { "textRaw": "Class: `Immediate`", "type": "class", "name": "Immediate", "desc": "<p>This object is created internally and is returned from <a href=\"#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>. It\ncan be passed to <a href=\"#timers_clearimmediate_immediate\"><code>clearImmediate()</code></a> in order to cancel the scheduled\nactions.</p>\n<p>By default, when an immediate is scheduled, the Node.js event loop will continue\nrunning as long as the immediate is active. The <code>Immediate</code> object returned by\n<a href=\"#timers_setimmediate_callback_args\"><code>setImmediate()</code></a> exports both <code>immediate.ref()</code> and <code>immediate.unref()</code>\nfunctions that can be used to control this default behavior.</p>", "methods": [ { "textRaw": "`immediate.hasRef()`", "type": "method", "name": "hasRef", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {boolean}", "name": "return", "type": "boolean" }, "params": [] } ], "desc": "<p>If true, the <code>Immediate</code> object will keep the Node.js event loop active.</p>" }, { "textRaw": "`immediate.ref()`", "type": "method", "name": "ref", "meta": { "added": [ "v9.7.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Immediate} a reference to `immediate`", "name": "return", "type": "Immediate", "desc": "a reference to `immediate`" }, "params": [] } ], "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<code>Immediate</code> is active. Calling <code>immediate.ref()</code> multiple times will have no\neffect.</p>\n<p>By default, all <code>Immediate</code> objects are \"ref'ed\", making it normally unnecessary\nto call <code>immediate.ref()</code> unless <code>immediate.unref()</code> had been called previously.</p>" }, { "textRaw": "`immediate.unref()`", "type": "method", "name": "unref", "meta": { "added": [ "v9.7.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Immediate} a reference to `immediate`", "name": "return", "type": "Immediate", "desc": "a reference to `immediate`" }, "params": [] } ], "desc": "<p>When called, the active <code>Immediate</code> object will not require the Node.js event\nloop to remain active. If there is no other activity keeping the event loop\nrunning, the process may exit before the <code>Immediate</code> object's callback is\ninvoked. Calling <code>immediate.unref()</code> multiple times will have no effect.</p>" } ] }, { "textRaw": "Class: `Timeout`", "type": "class", "name": "Timeout", "desc": "<p>This object is created internally and is returned from <a href=\"#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> and\n<a href=\"#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>. It can be passed to either <a href=\"#timers_cleartimeout_timeout\"><code>clearTimeout()</code></a> or\n<a href=\"#timers_clearinterval_timeout\"><code>clearInterval()</code></a> in order to cancel the scheduled actions.</p>\n<p>By default, when a timer is scheduled using either <a href=\"#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> or\n<a href=\"#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>, the Node.js event loop will continue running as long as the\ntimer is active. Each of the <code>Timeout</code> objects returned by these functions\nexport both <code>timeout.ref()</code> and <code>timeout.unref()</code> functions that can be used to\ncontrol this default behavior.</p>", "methods": [ { "textRaw": "`timeout.hasRef()`", "type": "method", "name": "hasRef", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {boolean}", "name": "return", "type": "boolean" }, "params": [] } ], "desc": "<p>If true, the <code>Timeout</code> object will keep the Node.js event loop active.</p>" }, { "textRaw": "`timeout.ref()`", "type": "method", "name": "ref", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Timeout} a reference to `timeout`", "name": "return", "type": "Timeout", "desc": "a reference to `timeout`" }, "params": [] } ], "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<code>Timeout</code> is active. Calling <code>timeout.ref()</code> multiple times will have no effect.</p>\n<p>By default, all <code>Timeout</code> objects are \"ref'ed\", making it normally unnecessary\nto call <code>timeout.ref()</code> unless <code>timeout.unref()</code> had been called previously.</p>" }, { "textRaw": "`timeout.refresh()`", "type": "method", "name": "refresh", "meta": { "added": [ "v10.2.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Timeout} a reference to `timeout`", "name": "return", "type": "Timeout", "desc": "a reference to `timeout`" }, "params": [] } ], "desc": "<p>Sets the timer's start time to the current time, and reschedules the timer to\ncall its callback at the previously specified duration adjusted to the current\ntime. This is useful for refreshing a timer without allocating a new\nJavaScript object.</p>\n<p>Using this on a timer that has already called its callback will reactivate the\ntimer.</p>" }, { "textRaw": "`timeout.unref()`", "type": "method", "name": "unref", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Timeout} a reference to `timeout`", "name": "return", "type": "Timeout", "desc": "a reference to `timeout`" }, "params": [] } ], "desc": "<p>When called, the active <code>Timeout</code> object will not require the Node.js event loop\nto remain active. If there is no other activity keeping the event loop running,\nthe process may exit before the <code>Timeout</code> object's callback is invoked. Calling\n<code>timeout.unref()</code> multiple times will have no effect.</p>\n<p>Calling <code>timeout.unref()</code> creates an internal timer that will wake the Node.js\nevent loop. Creating too many of these can adversely impact performance\nof the Node.js application.</p>" }, { "textRaw": "`timeout[Symbol.toPrimitive]()`", "type": "method", "name": "[Symbol.toPrimitive]", "meta": { "added": [ "v14.9.0" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {integer} a number that can be used to reference this `timeout`", "name": "return", "type": "integer", "desc": "a number that can be used to reference this `timeout`" }, "params": [] } ], "desc": "<p>Coerce a <code>Timeout</code> to a primitive. The primitive can be used to\nclear the <code>Timeout</code>. The primitive can only be used in the\nsame thread where the timeout was created. Therefore, to use it\nacross <a href=\"worker_threads.html\"><code>worker_threads</code></a> it must first be passed to the correct\nthread. This allows enhanced compatibility with browser\n<code>setTimeout()</code> and <code>setInterval()</code> implementations.</p>" } ] } ], "modules": [ { "textRaw": "Scheduling timers", "name": "scheduling_timers", "desc": "<p>A timer in Node.js is an internal construct that calls a given function after\na certain period of time. When a timer's function is called varies depending on\nwhich method was used to create the timer and what other work the Node.js\nevent loop is doing.</p>", "methods": [ { "textRaw": "`setImmediate(callback[, ...args])`", "type": "method", "name": "setImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Immediate} for use with [`clearImmediate()`][]", "name": "return", "type": "Immediate", "desc": "for use with [`clearImmediate()`][]" }, "params": [ { "textRaw": "`callback` {Function} The function to call at the end of this turn of the Node.js [Event Loop][]", "name": "callback", "type": "Function", "desc": "The function to call at the end of this turn of the Node.js [Event Loop][]" }, { "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.", "name": "...args", "type": "any", "desc": "Optional arguments to pass when the `callback` is called." } ] } ], "desc": "<p>Schedules the \"immediate\" execution of the <code>callback</code> after I/O events'\ncallbacks.</p>\n<p>When multiple calls to <code>setImmediate()</code> are made, the <code>callback</code> functions are\nqueued for execution in the order in which they are created. The entire callback\nqueue is processed every event loop iteration. If an immediate timer is queued\nfrom inside an executing callback, that timer will not be triggered until the\nnext event loop iteration.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#errors_class_typeerror\"><code>TypeError</code></a> will be thrown.</p>\n<p>This method has a custom variant for promises that is available using\n<a href=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setImmediatePromise = util.promisify(setImmediate);\n\nsetImmediatePromise('foobar').then((value) => {\n // value === 'foobar' (passing values is optional)\n // This is executed after all I/O callbacks.\n});\n\n// Or with async function\nasync function timerExample() {\n console.log('Before I/O callbacks');\n await setImmediatePromise();\n console.log('After I/O callbacks');\n}\ntimerExample();\n</code></pre>" }, { "textRaw": "`setInterval(callback[, delay[, ...args]])`", "type": "method", "name": "setInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Timeout} for use with [`clearInterval()`][]", "name": "return", "type": "Timeout", "desc": "for use with [`clearInterval()`][]" }, "params": [ { "textRaw": "`callback` {Function} The function to call when the timer elapses.", "name": "callback", "type": "Function", "desc": "The function to call when the timer elapses." }, { "textRaw": "`delay` {number} The number of milliseconds to wait before calling the `callback`. **Default**: `1`.", "name": "delay", "type": "number", "desc": "The number of milliseconds to wait before calling the `callback`. **Default**: `1`." }, { "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.", "name": "...args", "type": "any", "desc": "Optional arguments to pass when the `callback` is called." } ] } ], "desc": "<p>Schedules repeated execution of <code>callback</code> every <code>delay</code> milliseconds.</p>\n<p>When <code>delay</code> is larger than <code>2147483647</code> or less than <code>1</code>, the <code>delay</code> will be\nset to <code>1</code>. Non-integer delays are truncated to an integer.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#errors_class_typeerror\"><code>TypeError</code></a> will be thrown.</p>" }, { "textRaw": "`setTimeout(callback[, delay[, ...args]])`", "type": "method", "name": "setTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "return": { "textRaw": "Returns: {Timeout} for use with [`clearTimeout()`][]", "name": "return", "type": "Timeout", "desc": "for use with [`clearTimeout()`][]" }, "params": [ { "textRaw": "`callback` {Function} The function to call when the timer elapses.", "name": "callback", "type": "Function", "desc": "The function to call when the timer elapses." }, { "textRaw": "`delay` {number} The number of milliseconds to wait before calling the `callback`. **Default**: `1`.", "name": "delay", "type": "number", "desc": "The number of milliseconds to wait before calling the `callback`. **Default**: `1`." }, { "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.", "name": "...args", "type": "any", "desc": "Optional arguments to pass when the `callback` is called." } ] } ], "desc": "<p>Schedules execution of a one-time <code>callback</code> after <code>delay</code> milliseconds.</p>\n<p>The <code>callback</code> will likely not be invoked in precisely <code>delay</code> milliseconds.\nNode.js makes no guarantees about the exact timing of when callbacks will fire,\nnor of their ordering. The callback will be called as close as possible to the\ntime specified.</p>\n<p>When <code>delay</code> is larger than <code>2147483647</code> or less than <code>1</code>, the <code>delay</code>\nwill be set to <code>1</code>. Non-integer delays are truncated to an integer.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#errors_class_typeerror\"><code>TypeError</code></a> will be thrown.</p>\n<p>This method has a custom variant for promises that is available using\n<a href=\"util.html#util_util_promisify_original\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setTimeoutPromise = util.promisify(setTimeout);\n\nsetTimeoutPromise(40, 'foobar').then((value) => {\n // value === 'foobar' (passing values is optional)\n // This is executed after about 40 milliseconds.\n});\n</code></pre>" } ], "type": "module", "displayName": "Scheduling timers" }, { "textRaw": "Cancelling timers", "name": "cancelling_timers", "desc": "<p>The <a href=\"#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>, <a href=\"#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>, and <a href=\"#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a> methods\neach return objects that represent the scheduled timers. These can be used to\ncancel the timer and prevent it from triggering.</p>\n<p>For the promisified variants of <a href=\"#timers_setimmediate_callback_args\"><code>setImmediate()</code></a> and <a href=\"#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a>,\nan <a href=\"globals.html#globals_class_abortcontroller\"><code>AbortController</code></a> may be used to cancel the timer. When canceled, the\nreturned Promises will be rejected with an <code>'AbortError'</code>.</p>\n<p>For <code>setImmediate()</code>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setImmediatePromise = util.promisify(setImmediate);\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nsetImmediatePromise('foobar', { signal })\n .then(console.log)\n .catch((err) => {\n if (err.name === 'AbortError')\n console.log('The immediate was aborted');\n });\n\nac.abort();\n</code></pre>\n<p>For <code>setTimeout()</code>:</p>\n<pre><code class=\"language-js\">const util = require('util');\nconst setTimeoutPromise = util.promisify(setTimeout);\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nsetTimeoutPromise(1000, 'foobar', { signal })\n .then(console.log)\n .catch((err) => {\n if (err.name === 'AbortError')\n console.log('The timeout was aborted');\n });\n\nac.abort();\n</code></pre>", "methods": [ { "textRaw": "`clearImmediate(immediate)`", "type": "method", "name": "clearImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`immediate` {Immediate} An `Immediate` object as returned by [`setImmediate()`][].", "name": "immediate", "type": "Immediate", "desc": "An `Immediate` object as returned by [`setImmediate()`][]." } ] } ], "desc": "<p>Cancels an <code>Immediate</code> object created by <a href=\"#timers_setimmediate_callback_args\"><code>setImmediate()</code></a>.</p>" }, { "textRaw": "`clearInterval(timeout)`", "type": "method", "name": "clearInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`timeout` {Timeout|string|number} A `Timeout` object as returned by [`setInterval()`][] or the [primitive][] of the `Timeout` object as a string or a number.", "name": "timeout", "type": "Timeout|string|number", "desc": "A `Timeout` object as returned by [`setInterval()`][] or the [primitive][] of the `Timeout` object as a string or a number." } ] } ], "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"#timers_setinterval_callback_delay_args\"><code>setInterval()</code></a>.</p>" }, { "textRaw": "`clearTimeout(timeout)`", "type": "method", "name": "clearTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`timeout` {Timeout|string|number} A `Timeout` object as returned by [`setTimeout()`][] or the [primitive][] of the `Timeout` object as a string or a number.", "name": "timeout", "type": "Timeout|string|number", "desc": "A `Timeout` object as returned by [`setTimeout()`][] or the [primitive][] of the `Timeout` object as a string or a number." } ] } ], "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"#timers_settimeout_callback_delay_args\"><code>setTimeout()</code></a>.</p>" } ], "type": "module", "displayName": "Cancelling timers" } ], "type": "module", "displayName": "Timers" } ] }