Node.js
ライアン・ダール | |||||||||
Node.js Developers | |||||||||
2009 | |||||||||
| |||||||||
リポジトリ | |||||||||
プログラミング | C++, JavaScript | ||||||||
macOS, Linux, Solaris, FreeBSD, OpenBSD, Windows, webOS | |||||||||
プラットフォーム | x86, x64, ARM, Power, z/Architecture | ||||||||
イベント | |||||||||
ライセンス | MIT License | ||||||||
nodejs |
Node.js(ノード・ジェイエス) はV8 JavaScriptエンジン
概要 [編集 ]
V8 JavaScriptエンジンで
Node.jsはPythonのTwisted、PerlのPerl Object Environment、C
Node.jsを
例 [編集 ]
Node.jsによるHTTPサーバ
const http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(3000);
console.log('Server running at http://127.0.0.1:3000/');
3000
const net = require('net');
const server = net.createServer(function (stream) {
stream.write('hello\r\n');
stream.on('data', function (data) {
stream.write(data);
});
stream.on('end', function () {
stream.end('goodbye\r\n');
});
});
server.listen(3000, 'localhost');
モジュール[編集 ]
Node.jsは、バイナリにコンパイルされた
サードパーティーのモジュールはNode.jsを
Node.jsを
表明 [編集 ]
Node.jsはコアモジュール assert
によりassert.AssertionError
インスタンスがスローされる[12]。
const assert = require('assert').strict;
assert.deepEqual(1, 2);
// Thrown:
// AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
//
// 1 !== 2
ECMAScript modules[編集 ]
Node.jsは ECMAScript modules (ES module) に
拡張子 が.mjs
であるファイル拡張子 が.js
かつ最 近傍 の親 package.json
で"type":"module"
が指定 されたファイル--input-type=module
フラグと共 に引数 として渡 されたモジュール文字 列
リリース[編集 ]
Node.jsは
Release | Status | Code name | Release date | Active LTS start | Maintenance start | Maintenance end |
---|---|---|---|---|---|---|
v0.10.x | End-of-Life | 2013-03-11 | - | 2015-10-01 | 2016-10-31 | |
v0.12.x | End-of-Life | 2015-02-06 | - | 2016-04-01 | 2016-12-31 | |
4.x | End-of-Life | Argon | 2015-09-08 | 2015-10-01 | 2017-04-01 | 2018-04-30 |
5.x | End-of-Life | 2015-10-29 | N/A | 2016-06-30 | ||
6.x | End-of-Life | Boron | 2016-04-26 | 2016-10-18 | 2018-04-30 | 2019-04-30 |
7.x | End-of-Life | 2016-10-25 | N/A | 2017-06-30 | ||
8.x | End-of-Life | Carbon | 2017-05-30 | 2017-10-31 | 2019-01-01[16] | 2019-12-31 |
9.x | End-of-Life | 2017-10-01 | N/A | 2018-06-30 | ||
10.x | End-of-Life | Dubnium | 2018-04-24 | 2018-10-30 | 2020-05-19 | 2021-04-01 |
11.x | End-of-Life | 2018-10-23 | N/A | 2019-05-01 | 2019-06-01 | |
12.x | End-of-Life | Erbium | 2019-04-23 | 2019-10-21 | 2020-11-30 | 2022-04-30 |
13.x | End-of-Life | 2019-10-22 | N/A | 2020-04-01 | 2020-06-01 | |
14.x | End-of-Life | Fermium | 2020-04-21 | 2020-10-27 | 2021-10-19 | 2023-04-30 |
15.x | End-of-Life | 2020-10-20 | N/A | 2021-04-01 | 2021-06-01 | |
16.x | End-of-Life | Gallium | 2021-04-20 | 2021-10-26 | 2022-10-18 | 2023-09-11[17] |
17.x | End-of-Life | 2021-10-19 | N/A | 2022-04-01 | 2022-06-01 | |
18.x | Maintenance | Hydrogen | 2022-04-19 | 2022-10-25 | 2023-10-18 | 2025-04-30 |
19.x | End-of-Life | 2022-10-18 | N/A | 2023-04-01 | 2023-06-01 | |
20.x | Active LTS | Iron | 2023-04-18 | 2023-10-24 | 2024-10-22 | 2026-04-30 |
21.x | Current | 2023-10-17 | N/A | 2024-04-01 | 2024-06-01 | |
22.x | Pending | 2024-04-23 | 2024-10-29 | 2025-10-21 | 2027-04-30 | |
23.x | Pending | 2024-10-15 | N/A | 2025-04-01 | 2025-06-01 | |
24.x | Pending | 2025-04-22 | 2025-10-28 | 2026-10-20 | 2028-04-30 | |
サポート サポート |
コミュニティ[編集 ]
Windows版 [編集 ]
0.5.1より、Windowsネイティブ
クライアント1万 台 問題 [編集 ]
Node.jsでこの
Docker Image[編集 ]
Node.jsnode
/npm
/yarn
がプリインストールされている[23]。
node:<version>
: デファクトスタンダード[24]。Docker公式 のbuildpack-deps
を基 に構築 [25]node:alpine
: Alpine Linuxベース[26]。イメージサイズを最小 化 したい際 に推奨 される[27]node:slim
: Node.js動作 に必要 最低限 のパッケージのみを含 む[28]。サイズに制限 がない限 りデファクトイメージの利用 を強 く推奨 [29]
デフォルト
脚注 ・出典 [編集 ]
- ^ “Node.js v14 ChangeLog”. 2023
年 3月 12日 閲覧 。 - ^ “Node.js v16 ChangeLog”. 2023
年 3月 12日 閲覧 。 - ^ “Node.js v18 ChangeLog”. 2023
年 3月 12日 閲覧 。 - ^ “Node.js v19 ChangeLog”. 2023
年 3月 12日 閲覧 。 - ^ Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js
- ^ http://www.readwriteweb.com/hack/2011/01/wait-whats-nodejs-good-for-aga.php
- ^ http://mashable.com/2011/03/10/node-js/
- ^ Alex Handy (2011
年 6月 24日 ). “Node.js pushes JavaScript to the server-side”. SDTimes. 2011年 6月 24日 閲覧 。 - ^ http://wiki.commonjs.org/wiki/Implementations/node.js
- ^ “CommonJS Implementations”. 2011
年 5月 15日 閲覧 。 - ^ Ryswyck, Jan. “Taking Baby Steps with Node.js – CommonJS and Creating Custom Modules”. 2011
年 5月 15日 閲覧 。 - ^ All errors thrown by the
assert
module will be instances of theAssertionError
class. Node.js - ^ "Node.js fully supports ECMAScript modules" Modules: ECMAScript modules. Node.js v16.19.1 documentation. 2023-02-19
閲覧 . - ^ "Node.js will treat the following as ES modules ... Files with an
.mjs
extension ... Files with a.js
extension when the nearest parentpackage.json
file contains a top-level"type"
field with a value of"module"
. ... as an argument ... with the flag--input-type=module
." Modules: Packages. Node.js v16.19.1 documentation. 2023-02-19閲覧 . - ^ Production applications should only use Active LTS or Maintenance LTS releases. Node.js
- ^ “Node 8 reschedule”. 2019
年 1月 22日 閲覧 。 - ^ “Bringing forward the End-of-Life Date for Node.js 16”. 2023
年 2月 15日 閲覧 。 - ^ http://www.readwriteweb.com/hack/2011/04/nodeconf-schedule-announced.php
- ^ http://blog.nodejs.org/2011/07/14/node-v0-5-1/
- ^ https://github.com/joyent/libuv
- ^
福田 崇男 (2012年 7月 31日 ). “スタバ方式 で「C10K問題 」を解消 ”.日経 コンピュータ.日経 BP社 . 2017年 2月 20日 閲覧 。 - ^ The official Node.js docker image, made with love by the node community. [1]
- ^ All of the images contain pre-installed versions of
node
,npm
, andyarn
. [2] - ^ This is the defacto image. [3]
- ^ This tag is based off of
buildpack-deps
. [4] - ^ This image is based on the popular Alpine Linux project, available in the
alpine
official image. [5] - ^ This variant is highly recommended when final image size being as small as possible is desired. [6]
- ^ This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run
node
. [7] - ^ Unless you are working in an environment where only the Node.js image will be deployed and you have space constraints, we highly recommend using the default image of this repository. [8]
関連 項目 [編集 ]
外部 リンク[編集 ]
公式 ウェブサイト- Node.js (@nodejs) - X(
旧 Twitter) - node - GitHub
- Node.js
日本 ユーザグループ