doc: fix dns.resolveCname description typo
[platform/upstream/nodejs.git] / README.md
1 Node.js
2 =======
3
4 [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodejs/node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
6 Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js
7 uses an event-driven, non-blocking I/O model that makes it lightweight and
8 efficient. The Node.js package ecosystem, npm, is the largest ecosystem of open
9 source libraries in the world.
10
11 The Node.js project is supported by the
12 [Node.js Foundation](https://nodejs.org/en/foundation/). Contributions,
13 policies and releases are managed under an
14 [open governance model](./GOVERNANCE.md). We are also bound by a
15 [Code of Conduct](./CODE_OF_CONDUCT.md).
16
17 If you need help using or installing Node.js, please use the
18 [nodejs/help](https://github.com/nodejs/help) issue tracker.
19
20 ## Release Types
21
22 The Node.js project maintains multiple types of releases:
23
24 * **Stable**: Released from active development branches of this repository,
25   versioned by [SemVer](http://semver.org/) and signed by a member of the
26   [Release Team](#release-team).
27   Code for Stable releases is organized in this repository by major version
28   number, For example: [v4.x](https://github.com/nodejs/node/tree/v4.x).
29   The major version number of Stable releases will increment every 6 months
30   allowing for breaking changes to be introduced. This happens in April and
31   October every year. Stable release lines beginning in October each year have
32   a maximum support life of 8 months. Stable release lines beginning in April
33   each year will convert to LTS (see below) after 6 months and receive further
34   support for 30 months.
35 * **LTS**: Releases that receive Long-term Support, with a focus on stability
36   and security. Every second Stable release line (major version) will become an
37   LTS line and receive 18 months of _Active LTS_ support and a further 12
38   months of _Maintenance_. LTS release lines are given alphabetically
39   ordered codenames, beginning with v4 Argon. LTS releases are less frequent
40   and will attempt to maintain consistent major and minor version numbers,
41   only incrementing patch version numbers. There are no breaking changes or
42   feature additions, except in some special circumstances. More information
43   can be found in the [LTS README](https://github.com/nodejs/LTS/).
44 * **Nightly**: Versions of code in this repository on the current Stable
45   branch, automatically built every 24-hours where changes exist. Use with
46   caution.
47
48 ## Download
49
50 Binaries, installers, and source tarballs are available at
51 <https://nodejs.org>.
52
53 **Stable** and **LTS** releases are available at
54 <https://nodejs.org/download/release/>, listed under their version strings.
55 The [latest](https://nodejs.org/download/release/latest/) directory is an
56 alias for the latest Stable release. The latest LTS release from an LTS
57 line is available in the form: latest-_codename_. For example:
58 <https://nodejs.org/download/release/latest-argon>
59
60 **Nightly** builds are available at
61 <https://nodejs.org/download/nightly/>, listed under their version
62 string which includes their date (in UTC time) and the commit SHA at
63 the HEAD of the release.
64
65 **API documentation** is available in each release and nightly
66 directory under _docs_. <https://nodejs.org/api/> points to the API
67 documentation of the latest stable version.
68
69 ### Verifying Binaries
70
71 Stable, LTS and Nightly download directories all contain a *SHASUM256.txt*
72 file that lists the SHA checksums for each file available for
73 download. To check that a downloaded file matches the checksum, run
74 it through `sha256sum` with a command such as:
75
76 ```
77 $ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
78 ```
79
80 _(Where "node-vx.y.z.tar.gz" is the name of the file you have
81 downloaded)_
82
83 Additionally, Stable and LTS releases (not Nightlies) have GPG signed
84 copies of SHASUM256.txt files available as SHASUM256.txt.asc. You can use
85 `gpg` to verify that the file has not been tampered with.
86
87 To verify a SHASUM256.txt.asc, you will first need to import all of
88 the GPG keys of individuals authorized to create releases. They are
89 listed at the bottom of this README under [Release Team](#release-team).
90 Use a command such as this to import the keys:
91
92 ```
93 $ gpg --keyserver pool.sks-keyservers.net \
94   --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
95 ```
96
97 _(See the bottom of this README for a full script to import active
98 release keys)_
99
100 You can then use `gpg --verify SHASUMS256.txt.asc` to verify that the
101 file has been signed by an authorized member of the Node.js team.
102
103 Once verified, use the SHASUMS256.txt.asc file to get the checksum for
104 the binary verification command above.
105
106 ## Build
107
108 ### Unix / Macintosh
109
110 Prerequisites:
111
112 * `gcc` and `g++` 4.8 or newer, or
113 * `clang` and `clang++` 3.4 or newer
114 * Python 2.6 or 2.7
115 * GNU Make 3.81 or newer
116 * libexecinfo (FreeBSD and OpenBSD only)
117
118 ```text
119 $ ./configure
120 $ make
121 $ [sudo] make install
122 ```
123
124 If your Python binary is in a non-standard location or has a
125 non-standard name, run the following instead:
126
127 ```text
128 $ export PYTHON=/path/to/python
129 $ $PYTHON ./configure
130 $ make
131 $ [sudo] make install
132 ```
133
134 To run the tests:
135
136 ```text
137 $ make test
138 ```
139
140 To build the documentation:
141
142 ```text
143 $ make doc
144 ```
145
146 To read the documentation:
147
148 ```text
149 $ man doc/node.1
150 ```
151
152 To test if Node.js was built correctly:
153
154 ```
155 $ node -e "console.log('Hello from Node.js ' + process.version)"
156 ```
157
158 ### Windows
159
160 Prerequisites:
161
162 * [Python 2.6 or 2.7](https://www.python.org/downloads/)
163 * Visual Studio 2013 / 2015, all editions including the Community edition, or
164 * Visual Studio Express 2013 / 2015 for Desktop
165 * Basic Unix tools required for some tests,
166   [Git for Windows](http://git-scm.com/download/win) includes Git Bash
167   and tools which can be included in the global `PATH`.
168
169 ```text
170 > vcbuild nosign
171 ```
172
173 To run the tests:
174
175 ```text
176 > vcbuild test
177 ```
178
179 To test if Node.js was built correctly:
180
181 ```
182 $ node -e "console.log('Hello from Node.js ' + process.version)"
183 ```
184
185 ### Android / Android based devices, aka. Firefox OS
186
187 Be sure you have downloaded and extracted [Android NDK]
188 (https://developer.android.com/tools/sdk/ndk/index.html)
189 before in a folder. Then run:
190
191 ```
192 $ ./android-configure /path/to/your/android-ndk
193 $ make
194 ```
195
196 ### `Intl` (ECMA-402) support:
197
198 [Intl](https://github.com/nodejs/node/wiki/Intl) support is not
199 enabled by default.
200
201 #### "small" (English only) support
202
203 This option will build with "small" (English only) support, but
204 the full `Intl` (ECMA-402) APIs.  With `--download=all` it will
205 download the ICU library as needed.
206
207 Unix / Macintosh:
208
209 ```text
210 $ ./configure --with-intl=small-icu --download=all
211 ```
212
213 Windows:
214
215 ```text
216 > vcbuild small-icu download-all
217 ```
218
219 The `small-icu` mode builds with English-only data. You can add full
220 data at runtime.
221
222 *Note:* more docs are on
223 [the node wiki](https://github.com/nodejs/node/wiki/Intl).
224
225 #### Build with full ICU support (all locales supported by ICU):
226
227 With the `--download=all`, this may download ICU if you don't have an
228 ICU in `deps/icu`.
229
230 Unix / Macintosh:
231
232 ```text
233 $ ./configure --with-intl=full-icu --download=all
234 ```
235
236 Windows:
237
238 ```text
239 > vcbuild full-icu download-all
240 ```
241
242 #### Build with no Intl support `:-(`
243
244 The `Intl` object will not be available. This is the default at
245 present, so this option is not normally needed.
246
247 Unix / Macintosh:
248
249 ```text
250 $ ./configure --with-intl=none
251 ```
252
253 Windows:
254
255 ```text
256 > vcbuild intl-none
257 ```
258
259 #### Use existing installed ICU (Unix / Macintosh only):
260
261 ```text
262 $ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu
263 ```
264
265 If you are cross compiling, your `pkg-config` must be able to supply a path
266 that works for both your host and target environments.
267
268 #### Build with a specific ICU:
269
270 You can find other ICU releases at
271 [the ICU homepage](http://icu-project.org/download).
272 Download the file named something like `icu4c-**##.#**-src.tgz` (or
273 `.zip`).
274
275 Unix / Macintosh
276
277 ```text
278 # from an already-unpacked ICU:
279 $ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu
280
281 # from a local ICU tarball
282 $ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz
283
284 # from a tarball URL
285 $ ./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz
286 ```
287
288 Windows
289
290 First unpack latest ICU to `deps/icu`
291 [icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`)
292 as `deps/icu` (You'll have: `deps/icu/source/...`)
293
294 ```text
295 > vcbuild full-icu
296 ```
297
298 # Building Node.js with FIPS-compliant OpenSSL
299
300 NOTE: Windows is not yet supported
301
302 It is possible to build Node.js with
303 [OpenSSL FIPS module](https://www.openssl.org/docs/fips/fipsnotes.html).
304
305 **Note** that building in this way does **not** allow you to
306 claim that the runtime is FIPS 140-2 validated.  Instead you
307 can indicate that the runtime uses a validated module.  See
308 the [security policy]
309 (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf)
310 page 60 for more details.  In addition, the validation for
311 the underlying module is only valid if it is deployed in
312 accordance with its [security policy]
313 (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf).
314 If you need FIPS validated cryptography it is recommended that you
315 read both the [security policy]
316 (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf)
317 and [user guide] (https://openssl.org/docs/fips/UserGuide-2.0.pdf).
318
319 Instructions:
320
321 1. Obtain a copy of openssl-fips-x.x.x.tar.gz.
322    To comply with the security policy you must ensure the path
323    through which you get the file complies with the requirements
324    for a "secure installation" as described in section 6.6 in
325    the [user guide] (https://openssl.org/docs/fips/UserGuide-2.0.pdf).
326    For evaluation/experimentation you can simply download and verify
327    `openssl-fips-x.x.x.tar.gz` from https://www.openssl.org/source/
328 2. Extract source to `openssl-fips` folder and `cd openssl-fips`
329 3. `./config`
330 4. `make`
331 5. `make install`
332    (NOTE: to comply with the security policy you must use the exact
333    commands in steps 3-5 without any additional options as per
334    Appendix A in the [security policy]
335    (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf).
336    The only exception is that `./config no-asm` can be
337    used in place of `./config`, and the FIPSDIR environment variable
338    may be used to specify a non-standard install folder for the
339    validated module, as per User Guide sections 4.2.1, 4.2.2, and 4.2.3.
340 6. Get into Node.js checkout folder
341 7. `./configure --openssl-fips=/path/to/openssl-fips/installdir`
342    For example on ubuntu 12 the installation directory was
343    /usr/local/ssl/fips-2.0
344 8. Build Node.js with `make -j`
345 9. Verify with `node -p "process.versions.openssl"` (`1.0.2a-fips`)
346
347 ## Resources for Newcomers
348
349 * [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
350 * [CONTRIBUTING.md](./CONTRIBUTING.md)
351 * [GOVERNANCE.md](./GOVERNANCE.md)
352 * IRC (general questions): [#node.js on Freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)
353 * IRC (node core development): [#node-dev on Freenode.net](http://webchat.freenode.net?channels=node-dev&uio=d4)
354 * [nodejs/node on Gitter](https://gitter.im/nodejs/node)
355
356 ## Security
357
358 All security bugs in Node.js are taken seriously and should be reported by
359 emailing security@nodejs.org. This will be delivered to a subset of the project
360 team who handle security issues. Please don't disclose security bugs
361 publicly until they have been handled by the security team.
362
363 Your email will be acknowledged within 24 hours, and you’ll receive a more
364 detailed response to your email within 48 hours indicating the next steps in
365 handling your report.
366
367 ## Current Project Team Members
368
369 The Node.js project team comprises a group of core collaborators and a sub-group
370 that forms the _Core Technical Committee_ (CTC) which governs the project. For more
371 information about the governance of the Node.js project, see
372 [GOVERNANCE.md](./GOVERNANCE.md).
373
374 ### CTC (Core Technical Committee)
375
376 * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** &lt;info@bnoordhuis.nl&gt;
377 * [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** &lt;chalkerx@gmail.com&gt;
378 * [chrisdickinson](https://github.com/chrisdickinson) - **Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt;
379 * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** &lt;cjihrig@gmail.com&gt;
380 * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** &lt;evanlucas@me.com&gt;
381 * [fishrock123](https://github.com/fishrock123) - **Jeremiah Senkpiel** &lt;fishrock123@rocketmail.com&gt;
382 * [indutny](https://github.com/indutny) - **Fedor Indutny** &lt;fedor.indutny@gmail.com&gt;
383 * [jasnell](https://github.com/jasnell) - **James M Snell** &lt;jasnell@gmail.com&gt;
384 * [misterdjules](https://github.com/misterdjules) - **Julien Gilli** &lt;jgilli@nodejs.org&gt;
385 * [mscdex](https://github.com/mscdex) - **Brian White** &lt;mscdex@mscdex.net&gt;
386 * [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** &lt;ofrobots@google.com&gt;
387 * [orangemocha](https://github.com/orangemocha) - **Alexis Campailla** &lt;orangemocha@nodejs.org&gt;
388 * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** &lt;bertbelder@gmail.com&gt;
389 * [rvagg](https://github.com/rvagg) - **Rod Vagg** &lt;rod@vagg.org&gt;
390 * [shigeki](https://github.com/shigeki) - **Shigeki Ohtsu** &lt;ohtsu@iij.ad.jp&gt;
391 * [trevnorris](https://github.com/trevnorris) - **Trevor Norris** &lt;trev.norris@gmail.com&gt;
392 * [Trott](https://github.com/Trott) - **Rich Trott** &lt;rtrott@gmail.com&gt;
393
394 ### Collaborators
395
396 * [brendanashworth](https://github.com/brendanashworth) - **Brendan Ashworth** &lt;brendan.ashworth@me.com&gt;
397 * [calvinmetcalf](https://github.com/calvinmetcalf) - **Calvin Metcalf** &lt;calvin.metcalf@gmail.com&gt;
398 * [domenic](https://github.com/domenic) - **Domenic Denicola** &lt;d@domenic.me&gt;
399 * [geek](https://github.com/geek) - **Wyatt Preul** &lt;wpreul@gmail.com&gt;
400 * [iarna](https://github.com/iarna) - **Rebecca Turner** &lt;me@re-becca.org&gt;
401 * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** &lt;i@izs.me&gt;
402 * [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** &lt;bugs@bergstroem.nu&gt;
403 * [joaocgreis](https://github.com/joaocgreis) - **João Reis** &lt;reis@janeasystems.com&gt;
404 * [julianduque](https://github.com/julianduque) - **Julian Duque** &lt;julianduquej@gmail.com&gt;
405 * [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** &lt;jmwsoft@gmail.com&gt;
406 * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** &lt;lxe@lxe.co&gt;
407 * [mcollina](https://github.com/mcollina) - **Matteo Collina** &lt;matteo.collina@gmail.com&gt;
408 * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** &lt;michael_dawson@ca.ibm.com&gt;
409 * [micnic](https://github.com/micnic) - **Nicu Micleușanu** &lt;micnic90@gmail.com&gt;
410 * [mikeal](https://github.com/mikeal) - **Mikeal Rogers** &lt;mikeal.rogers@gmail.com&gt;
411 * [monsanto](https://github.com/monsanto) - **Christopher Monsanto** &lt;chris@monsan.to&gt;
412 * [Olegas](https://github.com/Olegas) - **Oleg Elifantiev** &lt;oleg@elifantiev.ru&gt;
413 * [petkaantonov](https://github.com/petkaantonov) - **Petka Antonov** &lt;petka_antonov@hotmail.com&gt;
414 * [qard](https://github.com/qard) - **Stephen Belanger** &lt;admin@stephenbelanger.com&gt;
415 * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** &lt;alex@kocharin.ru&gt;
416 * [rmg](https://github.com/rmg) - **Ryan Graham** &lt;r.m.graham@gmail.com&gt;
417 * [robertkowalski](https://github.com/robertkowalski) - **Robert Kowalski** &lt;rok@kowalski.gd&gt;
418 * [romankl](https://github.com/romankl) - **Roman Klauke** &lt;romaaan.git@gmail.com&gt;
419 * [saghul](https://github.com/saghul) - **Saúl Ibarra Corretgé** &lt;saghul@gmail.com&gt;
420 * [sam-github](https://github.com/sam-github) - **Sam Roberts** &lt;vieuxtech@gmail.com&gt;
421 * [seishun](https://github.com/seishun) - **Nikolai Vavilov** &lt;vvnicholas@gmail.com&gt;
422 * [silverwind](https://github.com/silverwind) - **Roman Reiss** &lt;me@silverwind.io&gt;
423 * [srl295](https://github.com/srl295) - **Steven R Loomis** &lt;srloomis@us.ibm.com&gt;
424 * [targos](https://github.com/targos) - **Michaël Zasso** &lt;mic.besace@gmail.com&gt;
425 * [tellnes](https://github.com/tellnes) - **Christian Tellnes** &lt;christian@tellnes.no&gt;
426 * [thealphanerd](https://github.com/thealphanerd) - **Myles Borins** &lt;myles.borins@gmail.com&gt;
427 * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** &lt;thechargingvolcano@gmail.com&gt;
428 * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** &lt;thlorenz@gmx.de&gt;
429 * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** &lt;m.j.tunnicliffe@gmail.com&gt;
430 * [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** &lt;vladimir.kurchatkin@gmail.com&gt;
431 * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** &lt;yosuke.furukawa@gmail.com&gt;
432 * [zkat](https://github.com/zkat) - **Kat Marchán** &lt;kzm@sykosomatic.org&gt;
433
434 Collaborators & CTC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in
435 maintaining the Node.js project.
436
437 ### Release Team
438
439 Releases of Node.js and io.js will be signed with one of the following GPG keys:
440
441 * **Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt; `9554F04D7259F04124DE6B476D5A82AC7E37093B`
442 * **Colin Ihrig** &lt;cjihrig@gmail.com&gt; `94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
443 * **Evan Lucas** &lt;evanlucas@me.com&gt; `B9AE9905FFD7803F25714661B63B535A4C206CA9`
444 * **James M Snell** &lt;jasnell@keybase.io&gt; `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1`
445 * **Jeremiah Senkpiel** &lt;fishrock@keybase.io&gt; `FD3A5288F042B6850C66B31F09FE44734EB7990E`
446 * **Myles Borins** &lt;myles.borins@gmail.com&gt; `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8`
447 * **Rod Vagg** &lt;rod@vagg.org&gt; `DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
448 * **Sam Roberts** &lt;octetcloud@keybase.io&gt; `0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93`
449
450 The full set of trusted release keys can be imported by running:
451
452 ```
453 gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B
454 gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
455 gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93
456 gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E
457 gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
458 gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
459 gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8
460 gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9
461 ```
462
463 See the section above on [Verifying Binaries](#verifying-binaries) for
464 details on what to do with these keys to verify that a downloaded file is official.
465
466 Previous releases of Node.js have been signed with one of the following GPG
467 keys:
468
469 * **Isaac Z. Schlueter** &lt;i@izs.me&gt; `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6`
470 * **Julien Gilli** &lt;jgilli@fastmail.fm&gt; `114F43EE0176B71C7BC219DD50A3051F888C628D`
471 * **Timothy J Fontaine** &lt;tjfontaine@gmail.com&gt; `7937DFD2AB06298B2293C3187D33FF9D0246406D`