2020-11-22 18:54:56 +08:00
|
|
|
<!DOCTYPE html>
|
2011-12-20 12:57:45 +08:00
|
|
|
<html lang="en">
|
2010-10-28 20:18:54 +08:00
|
|
|
<head>
|
2011-12-20 12:57:45 +08:00
|
|
|
<meta charset="utf-8">
|
2017-09-29 04:27:29 +08:00
|
|
|
<meta name="viewport" content="width=device-width">
|
2020-07-01 03:35:28 +08:00
|
|
|
<meta name="nodejs.org:node-version" content="__VERSION__">
|
2016-08-02 01:31:28 +08:00
|
|
|
<title>__SECTION__ | Node.js __VERSION__ Documentation</title>
|
2019-09-24 15:02:52 +08:00
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic&display=fallback">
|
2011-12-13 06:19:14 +08:00
|
|
|
<link rel="stylesheet" href="assets/style.css">
|
2020-05-17 03:54:24 +08:00
|
|
|
<link rel="stylesheet" href="assets/hljs.css">
|
2015-08-14 00:14:34 +08:00
|
|
|
<link rel="canonical" href="https://nodejs.org/api/__FILENAME__.html">
|
2010-10-28 20:18:54 +08:00
|
|
|
</head>
|
2012-02-28 02:59:51 +08:00
|
|
|
<body class="alt apidoc" id="api-section-__FILENAME__">
|
2015-01-14 16:00:59 +08:00
|
|
|
<div id="content" class="clearfix">
|
|
|
|
<div id="column2" class="interior">
|
2016-02-12 03:11:09 +08:00
|
|
|
<div id="intro" class="interior">
|
|
|
|
<a href="/" title="Go back to the home page">
|
2016-04-13 01:25:44 +08:00
|
|
|
Node.js
|
2016-02-12 03:11:09 +08:00
|
|
|
</a>
|
2015-01-14 16:00:59 +08:00
|
|
|
</div>
|
2016-02-12 03:11:09 +08:00
|
|
|
__GTOC__
|
2015-01-14 16:00:59 +08:00
|
|
|
</div>
|
2012-01-22 12:02:16 +08:00
|
|
|
|
2015-01-14 16:00:59 +08:00
|
|
|
<div id="column1" data-id="__ID__" class="interior">
|
|
|
|
<header>
|
2020-11-22 18:54:56 +08:00
|
|
|
<div class="header-container">
|
|
|
|
<h1>Node.js __VERSION__ Documentation</h1>
|
2021-01-24 14:28:31 +08:00
|
|
|
<button class="theme-toggle-btn" id="theme-toggle-btn" title="Toggle dark mode/light mode" aria-label="Toggle dark mode/light mode" hidden>
|
2020-11-22 18:54:56 +08:00
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" height="24" width="24">
|
|
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
|
|
|
<path d="M11.1 12.08c-2.33-4.51-.5-8.48.53-10.07C6.27 2.2 1.98 6.59 1.98 12c0 .14.02.28.02.42.62-.27 1.29-.42 2-.42 1.66 0 3.18.83 4.1 2.15A4.01 4.01 0 0111 18c0 1.52-.87 2.83-2.12 3.51.98.32 2.03.5 3.11.5 3.5 0 6.58-1.8 8.37-4.52-2.36.23-6.98-.97-9.26-5.41z"/>
|
|
|
|
<path d="M7 16h-.18C6.4 14.84 5.3 14 4 14c-1.66 0-3 1.34-3 3s1.34 3 3 3h3c1.1 0 2-.9 2-2s-.9-2-2-2z"/>
|
|
|
|
</svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" height="24" width="24">
|
|
|
|
<path d="M0 0h24v24H0z" fill="none" />
|
|
|
|
<path d="M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"/>
|
|
|
|
</svg>
|
|
|
|
</button>
|
|
|
|
</div>
|
2015-01-14 16:00:59 +08:00
|
|
|
<div id="gtoc">
|
2017-01-23 11:16:21 +08:00
|
|
|
<ul>
|
|
|
|
<li>
|
2020-08-24 03:26:41 +08:00
|
|
|
<a href="index.html">Index</a>
|
2017-01-23 11:16:21 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2017-09-14 08:37:32 +08:00
|
|
|
<a href="all.html">View on single page</a>
|
2017-01-23 11:16:21 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2017-09-14 08:37:32 +08:00
|
|
|
<a href="__FILENAME__.json">View as JSON</a>
|
2017-01-23 11:16:21 +08:00
|
|
|
</li>
|
2017-09-14 08:37:32 +08:00
|
|
|
__ALTDOCS__
|
2018-07-08 06:33:06 +08:00
|
|
|
__EDIT_ON_GITHUB__
|
2017-01-23 11:16:21 +08:00
|
|
|
</ul>
|
2015-01-14 16:00:59 +08:00
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
</header>
|
2012-02-28 02:59:51 +08:00
|
|
|
|
2021-01-24 10:58:26 +08:00
|
|
|
__TOC__
|
2012-02-28 02:59:51 +08:00
|
|
|
|
2015-01-14 16:00:59 +08:00
|
|
|
<div id="apicontent">
|
|
|
|
__CONTENT__
|
2020-07-01 03:35:28 +08:00
|
|
|
<!-- API END -->
|
2015-01-14 16:00:59 +08:00
|
|
|
</div>
|
2012-01-22 12:02:16 +08:00
|
|
|
</div>
|
2015-01-14 16:00:59 +08:00
|
|
|
</div>
|
2021-01-15 00:56:09 +08:00
|
|
|
<script>
|
2020-11-22 18:54:56 +08:00
|
|
|
'use strict';
|
|
|
|
{
|
|
|
|
const kCustomPreference = 'customDarkTheme';
|
|
|
|
const userSettings = sessionStorage.getItem(kCustomPreference);
|
|
|
|
const themeToggleButton = document.getElementById('theme-toggle-btn');
|
|
|
|
if (userSettings === null && window.matchMedia) {
|
|
|
|
const mq = window.matchMedia('(prefers-color-scheme: dark)');
|
|
|
|
if ('onchange' in mq) {
|
|
|
|
function mqChangeListener(e) {
|
|
|
|
document.body.classList.toggle('dark-mode', e.matches);
|
|
|
|
}
|
|
|
|
mq.addEventListener('change', mqChangeListener);
|
|
|
|
if (themeToggleButton) {
|
|
|
|
themeToggleButton.addEventListener('click', function() {
|
|
|
|
mq.removeEventListener('change', mqChangeListener);
|
|
|
|
}, { once: true });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (mq.matches) {
|
|
|
|
document.body.classList.add('dark-mode');
|
|
|
|
}
|
|
|
|
} else if (userSettings === 'true') {
|
|
|
|
document.body.classList.add('dark-mode');
|
|
|
|
}
|
|
|
|
if (themeToggleButton) {
|
|
|
|
themeToggleButton.hidden = false;
|
|
|
|
themeToggleButton.addEventListener('click', function() {
|
|
|
|
sessionStorage.setItem(
|
|
|
|
kCustomPreference,
|
|
|
|
document.body.classList.toggle('dark-mode')
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2021-01-15 00:56:09 +08:00
|
|
|
</script>
|
|
|
|
</body>
|
2011-07-15 06:56:15 +08:00
|
|
|
</html>
|