You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
4.3 KiB

.TH NODE 1 2016 Node.js Node.js
.\ This is a man page comment.
.\ Man page syntax (actually troff syntax) is somewhat obscure, but the
.\ important part is is that .<letter> specifies <letter>'s syntax for that
.\ line, and \f<letter> specifies it for the characters that follow.
.\ See http://liw.fi/manpages/ for more info.
.SH NAME
node \- Server-side JavaScript runtime
.SH SYNOPSIS
.B node
[\fIoptions\fR] [\fIv8 options\fR]
[\fIscript.js\fR | \fB\-e \fR"\fIscript\fR"]
[\fIarguments\fR]
.br
.B node debug
[\fIscript.js\fR | \fB\-e \fR"\fIscript\fR" | \fI<host>:<port>\fR] \fI...
.br
.B node
[\fB\-\-v8-options\fR]
Execute without arguments to start the REPL.
.SH DESCRIPTION
Node.js is a set of libraries for JavaScript which allows it to be used outside
of the browser. It is primarily focused on creating simple, easy to build
network clients and servers.
.SH OPTIONS
.TP
.BR \-v ", " \-\-version
Print node's version.
.TP
.BR \-h ", " \-\-help
Print node command line options.
The output of this option is less detailed than this document.
.TP
.BR \-e ", " \-\-eval " " \fR"\fIscript\fR"
Evaluate the following argument as JavaScript.
.TP
.BR \-p ", " \-\-print " " \fR"\fIscript\fR"
Identical to \fB-e\fR but prints the result.
.TP
.BR \-c ", " \-\-check
Syntax check the script without executing.
.TP
.BR \-i ", " \-\-interactive
Open the REPL even if stdin does not appear to be a terminal.
.TP
.BR \-r ", " \-\-require " " \fImodule\fR
Preload the specified module at startup. Follows `require()`'s module resolution
rules. \fImodule\fR may be either a path to a file, or a node module name.
.TP
.BR \-\-no\-deprecation
Silence deprecation warnings.
.TP
.BR \-\-trace\-deprecation
Print stack traces for deprecations.
.TP
.BR \-\-throw\-deprecation
Throw errors for deprecations.
process: add &#39;warning&#39; event and process.emitWarning() In several places throughout the code we write directly to stderr to report warnings (deprecation, possible eventemitter memory leak). The current design of simply dumping the text to stderr is less than ideal. This PR introduces a new &#34;process warnings&#34; mechanism that emits &#39;warning&#39; events on the global process object. These are invoked with a `warning` argument whose value is an Error object. By default, these warnings will be printed to stderr. This can be suppressed using the `--no-warnings` and `--no-deprecation` command line flags. For warnings, the &#39;warning&#39; event will still be emitted by the process, allowing applications to handle the warnings in custom ways. The existing `--no-deprecation` flag will continue to supress all deprecation output generated by the core lib. The `--trace-warnings` command line flag will tell Node.js to print the full stack trace of warnings as part of the default handling. The existing `--no-deprecation`, `--throw-deprecation` and `--trace-deprecation` flags continue to work as they currently do, but the exact output of the warning message is modified to occur on process.nextTick(). The stack trace for the warnings and deprecations preserve and point to the correct call site. A new `process.emitWarning()` API is provided to permit userland to emit warnings and deprecations using the same consistent mechanism. Test cases and documentation are included. PR-URL: https://github.com/nodejs/node/pull/4782 Reviewed-By: Rod Vagg &lt;rod@vagg.org&gt; Reviewed-By: Wyatt Preul &lt;wpreul@gmail.com&gt; Reviewed-By: Jeremiah Senkpiel &lt;fishrock123@rocketmail.com&gt;
9 years ago
.TP
.BR \-\-no\-warnings
Silence all process warnings (including deprecations).
.TP
.BR \-\-trace\-warnings
Print stack traces for process warnings (including deprecations).
.TP
.BR \-\-trace\-sync\-io
Print a stack trace whenever synchronous I/O is detected after the first turn
of the event loop.
.TP
.BR \-\-zero\-fill\-buffers
Automatically zero-fills all newly allocated Buffer and SlowBuffer instances.
.TP
.BR \-\-track\-heap-objects
Track heap object allocations for heap snapshots.
.TP
.BR \-\-prof\-process
Process v8 profiler output generated using the v8 option \fB\-\-prof\fR
.TP
.BR \-\-v8\-options
Print v8 command line options.
.TP
.BR \-\-v8\-pool\-size =\fInum\fR
Set v8's thread pool size which will be used to allocate background jobs.
If set to 0 then v8 will choose an appropriate size of the thread pool based
on the number of online processors. If the value provided is larger than v8's
max then the largest value will be chosen.
.TP
.BR \-\-tls\-cipher\-list =\fIlist\fR
Specify an alternative default TLS cipher list. (Requires Node.js to be built with crypto support. (Default))
.TP
.BR \-\-enable\-fips
Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with \fB./configure \-\-openssl\-fips\fR)
.TP
.BR \-\-force\-fips
Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) (Same requirements as \fB\-\-enable\-fips\fR)
.TP
.BR \-\-icu\-data\-dir =\fIfile\fR
Specify ICU data load path. (overrides \fBNODE_ICU_DATA\fR)
.SH ENVIRONMENT VARIABLES
.TP
.BR NODE_DEBUG =\fImodule\fR[,\fI...\fR]
\',\'\-separated list of core modules that should print debug information.
.TP
.BR NODE_PATH =\fIpath\fR[:\fI...\fR]
\':\'\-separated list of directories prefixed to the module search path.
.TP
.BR NODE_DISABLE_COLORS=1
When set to 1 colors will not be used in the REPL.
.TP
.BR NODE_ICU_DATA =\fIfile\fR
Data path for ICU (Intl object) data. Will extend linked-in data when compiled
with small\-icu support.
.TP
.BR NODE_REPL_HISTORY =\fIfile\fR
Path to the file used to store the persistent REPL history. The default path
is ~/.node_repl_history, which is overridden by this variable. Setting the
value to an empty string ("" or " ") disables persistent REPL history.
.SH RESOURCES AND DOCUMENTATION
Website: \fBhttps://nodejs.org/\fR
Documentation: \fBhttps://nodejs.org/api/\fR
GitHub repository & Issue Tracker: \fBhttps://github.com/nodejs/node\fR
Mailing list: \fBhttp://groups.google.com/group/nodejs\fR
IRC (general questions): \fBchat.freenode.net #node.js\fR
IRC (node core development): \fBchat.freenode.net #node-dev\fR