mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
Add support for abi stable module API (N-API) as "Experimental feature". The goal of this API is to provide a stable Node API for native module developers. N-API aims to provide ABI compatibility guarantees across different Node versions and also across different Node VMs - allowing N-API enabled native modules to just work across different versions and flavors of Node.js without recompilation. A more detailed introduction is provided in: https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf. The feature, during its experimental state, will be guarded by a runtime flag "--napi-modules". Only when this flag is added to the command line will N-API modules along with regular non N-API modules be supported. The API is defined by the methods in "src/node_api.h" and "src/node_api_types.h". This is the best starting point to review the API surface. More documentation will follow. In addition to the implementation of the API using V8, which is included in this PR, the API has also been validated against chakracore and that port is available in https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x. The current plan is to provide N-API support in versions 8.X and 6.X directly. For older versions, such as 4.X or pre N-API versions of 6.X, we plan to create an external npm module to provide a migration path that will allow modules targeting older Node.js versions to use the API, albeit without getting the advantage of not having to recompile. In addition, we also plan an external npm package with C++ sugar to simplify the use of the API. The sugar will be in-line only and will only use the exported N-API methods but is not part of the N-API itself. The current version is in: https://github.com/nodejs/node-api. This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the api-prototype-8.x branch with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Ian Halliday <ianhall@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/11975 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
318 lines
8.4 KiB
Groff
318 lines
8.4 KiB
Groff
.TH NODE 1 2016 Node.js Node.js
|
|
|
|
.\" This is a man page comment.
|
|
|
|
.\" Man page syntax (actually roff 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.
|
|
|
|
.\" .B Bold line
|
|
.\" .I Italic line (Rendered as underlined text in terminals)
|
|
.\" .BI Alternating bold/italics without spaces between arguments.
|
|
.\" Use `\ ` to include an "unpaddable" (literal) space in the output.
|
|
.\" .RI Alternating roman/italic
|
|
|
|
.\" See http://liw.fi/manpages/ for an overview, or http://www.troff.org/54.pdf
|
|
.\" for detailed language reference.
|
|
|
|
.\" Macro to display an underlined URL in bold
|
|
.de ur
|
|
.nr CF \\n(.f
|
|
.ft 4
|
|
\\$1
|
|
.ft \\n(CF
|
|
..
|
|
|
|
|
|
.SH NAME
|
|
|
|
node \- Server-side JavaScript runtime
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B node
|
|
.RI [ options ]
|
|
.RI [ v8\ options ]
|
|
.RI [ script.js \ |
|
|
.B -e
|
|
.RI \&" script \&"]
|
|
.B [--]
|
|
.RI [ arguments ]
|
|
.br
|
|
.B node debug
|
|
.RI [ script.js " | "
|
|
.B \-e
|
|
.RI \&" script \&"\ |
|
|
.IR <host>:<port> ]
|
|
.I ...
|
|
.br
|
|
.B node
|
|
.RB [ \-\-v8-options ]
|
|
|
|
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.
|
|
|
|
.TP
|
|
.BR \-\-no\-warnings
|
|
Silence all process warnings (including deprecations).
|
|
|
|
.TP
|
|
.BR \-\-napi\-modules
|
|
Enable loading native modules compiled with the ABI-stable Node.js API (N-API)
|
|
(experimental).
|
|
|
|
.TP
|
|
.BR \-\-trace\-warnings
|
|
Print stack traces for process warnings (including deprecations).
|
|
|
|
.TP
|
|
.BR \-\-redirect\-warnings=\fIfile\fR
|
|
Write process warnings to the given file instead of printing to stderr.
|
|
|
|
.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 \-\-preserve\-symlinks
|
|
Instructs the module loader to preserve symbolic links when resolving and
|
|
caching modules.
|
|
|
|
.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.
|
|
|
|
Note: v8 options allow words to be separated by both dashes (\fB-\fR) or
|
|
underscores (\fB_\fR).
|
|
|
|
For example, \fB\-\-stack\-trace\-limit\fR is equivalent to
|
|
\fB\-\-stack\_trace\_limit\fR
|
|
|
|
.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 \-\-openssl\-config =\fIfile\fR
|
|
Load an OpenSSL configuration file on startup. Among other uses, this can be
|
|
used to enable FIPS-compliant crypto if Node.js is built with
|
|
\fB./configure \-\-openssl\-fips\fR.
|
|
|
|
.TP
|
|
.BR \-\-use\-openssl\-ca,\-\-use\-bundled\-ca
|
|
Use OpenSSL's default CA store or use bundled Mozilla CA store as supplied by
|
|
current Node.js version. The default store is selectable at build-time.
|
|
|
|
Using OpenSSL store allows for external modifications of the store. For most
|
|
Linux and BSD distributions, this store is maintained by the distribution
|
|
maintainers and system administrators. OpenSSL CA store location is dependent on
|
|
configuration of the OpenSSL library but this can be altered at runtime using
|
|
environment variables.
|
|
|
|
The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store
|
|
that is fixed at release time. It is identical on all supported platforms.
|
|
|
|
See \fBSSL_CERT_DIR\fR and \fBSSL_CERT_FILE\fR.
|
|
|
|
.TP
|
|
.BR \-\-icu\-data\-dir =\fIfile\fR
|
|
Specify ICU data load path. (overrides \fBNODE_ICU_DATA\fR)
|
|
|
|
.TP
|
|
.BR \-\-\fR
|
|
Indicate the end of node options. Pass the rest of the arguments to the script.
|
|
|
|
If no script filename or eval/print script is supplied prior to this, then
|
|
the next argument will be used as a script filename.
|
|
|
|
.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_NO_WARNINGS =\fI1\fR
|
|
When set to \fI1\fR, process warnings are silenced.
|
|
|
|
.TP
|
|
.BR NODE_OPTIONS =\fIoptions...\fR
|
|
\fBoptions...\fR are interpreted as if they had been specified on the command
|
|
line before the actual command line (so they can be overriden). Node will exit
|
|
with an error if an option that is not allowed in the environment is used, such
|
|
as \fB-p\fR or a script file.
|
|
|
|
.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.
|
|
|
|
.TP
|
|
.BR NODE_TTY_UNSAFE_ASYNC=1
|
|
When set to 1, writes to stdout and stderr will be non-blocking and asynchronous
|
|
when outputting to a TTY on platforms which support async stdio.
|
|
Setting this will void any guarantee that stdio will not be interleaved or
|
|
dropped at program exit. \fBAvoid use.\fR
|
|
|
|
.TP
|
|
|
|
.BR OPENSSL_CONF = \fIfile\fR
|
|
Load an OpenSSL configuration file on startup. Among other uses, this can be
|
|
used to enable FIPS-compliant crypto if Node.js is built with
|
|
\fB./configure \-\-openssl\-fips\fR.
|
|
|
|
If the
|
|
\fB\-\-openssl\-config\fR
|
|
command line option is used, the environment variable is ignored.
|
|
|
|
.BR SSL_CERT_DIR = \fIdir\fR
|
|
If \fB\-\-use\-openssl\-ca\fR is enabled, this overrides and sets OpenSSL's directory
|
|
containing trusted certificates.
|
|
|
|
.TP
|
|
.BR SSL_CERT_FILE = \fIfile\fR
|
|
If \fB\-\-use\-openssl\-ca\fR is enabled, this overrides and sets OpenSSL's
|
|
file containing trusted certificates.
|
|
|
|
.TP
|
|
.BR NODE_REDIRECT_WARNINGS=\fIfile\fR
|
|
Write process warnings to the given file instead of printing to stderr.
|
|
(equivalent to using the \-\-redirect\-warnings=\fIfile\fR command-line
|
|
argument).
|
|
|
|
.SH BUGS
|
|
Bugs are tracked in GitHub Issues:
|
|
.ur https://github.com/nodejs/node/issues
|
|
|
|
|
|
.SH AUTHORS
|
|
Written and maintained by 1000+ contributors:
|
|
.ur https://github.com/nodejs/node/blob/master/AUTHORS
|
|
|
|
|
|
.SH COPYRIGHT
|
|
Copyright Node.js contributors. Node.js is available under the MIT license.
|
|
|
|
Node.js also includes external libraries that are available under a variety
|
|
of licenses. See
|
|
.ur https://github.com/nodejs/node/blob/master/LICENSE
|
|
for the full license text.
|
|
|
|
|
|
.SH RESOURCES AND DOCUMENTATION
|
|
Website:
|
|
.ur https://nodejs.org/
|
|
|
|
Documentation:
|
|
.ur https://nodejs.org/api/
|
|
|
|
GitHub repository & Issue Tracker:
|
|
.ur https://github.com/nodejs/node
|
|
|
|
Mailing list:
|
|
.ur http://groups.google.com/group/nodejs
|
|
|
|
IRC (general questions):
|
|
.ur "chat.freenode.net #node.js"
|
|
(unofficial)
|
|
|
|
IRC (Node.js core development):
|
|
.ur "chat.freenode.net #node-dev"
|