node/doc/node.1

446 lines
19 KiB
Groff
Raw Normal View History

.TH NODE.JS "1" "2010" "" ""
.SH "NAME"
node \- Server-side JavaScript
.SH SYNOPSIS
.B node
[
.B \-v
]
[
.B \-\-debug
|
.B \-\-debug-brk
]
[
.B \-\-v8-options
]
.br
[
.B \-e
.I command
|
.I script.js
]
[
.I arguments
]
Execute without arguments to start the REPL.
.SH DESCRIPTION
Node is a set of libraries for javascript which allows
2011-01-11 05:50:46 +08:00
it to be used outside of the browser. It is primarily
focused on creating simple, easy to build network clients
and servers.
.SH ENVIRONMENT VARIABLES
.IP NODE_PATH
\':\'\-separated list of directories prefixed to the module search path.
.IP NODE_MODULE_CONTEXTS
If set to 1 then modules will load in their own global contexts.
.IP NODE_DISABLE_COLORS
If set to 1 then colors will not be used in the REPL.
2011-02-20 12:56:20 +08:00
.SH V8 OPTIONS
2012-02-19 05:36:34 +08:00
--harmony_typeof (enable harmony semantics for typeof)
type: bool default: false
--harmony_proxies (enable harmony proxies)
type: bool default: false
--harmony_weakmaps (enable harmony weak maps)
type: bool default: false
--harmony_block_scoping (enable harmony block scoping)
2011-02-20 12:56:20 +08:00
type: bool default: false
2012-02-19 05:36:34 +08:00
--unbox_double_arrays (automatically unbox arrays of doubles)
type: bool default: true
--string_slices (use string slices)
type: bool default: false
--crankshaft (use crankshaft)
type: bool default: true
2011-02-20 12:56:20 +08:00
--hydrogen_filter (hydrogen use/trace filter)
2012-02-19 05:36:34 +08:00
type: string default:
2011-02-20 12:56:20 +08:00
--use_hydrogen (use generated hydrogen for compilation)
type: bool default: true
--build_lithium (use lithium chunk builder)
type: bool default: true
--alloc_lithium (use lithium register allocator)
type: bool default: true
--use_lithium (use lithium code generator)
type: bool default: true
--use_range (use hydrogen range analysis)
type: bool default: true
--eliminate_dead_phis (eliminate dead phis)
type: bool default: true
--use_gvn (use hydrogen global value numbering)
type: bool default: true
--use_canonicalizing (use hydrogen instruction canonicalizing)
type: bool default: true
--use_inlining (use function inlining)
type: bool default: true
--limit_inlining (limit code size growth from inlining)
type: bool default: true
--eliminate_empty_blocks (eliminate empty blocks)
type: bool default: true
--loop_invariant_code_motion (loop invariant code motion)
type: bool default: true
2012-02-19 05:36:34 +08:00
--hydrogen_stats (print statistics for hydrogen)
2011-02-20 12:56:20 +08:00
type: bool default: false
--trace_hydrogen (trace generated hydrogen to file)
type: bool default: false
--trace_inlining (trace inlining decisions)
type: bool default: false
--trace_alloc (trace register allocator)
type: bool default: false
2012-02-19 05:36:34 +08:00
--trace_all_uses (trace all use positions)
type: bool default: false
2011-02-20 12:56:20 +08:00
--trace_range (trace range analysis)
type: bool default: false
--trace_gvn (trace global value numbering)
type: bool default: false
--trace_representation (trace representation types)
type: bool default: false
--stress_pointer_maps (pointer map for every instruction)
type: bool default: false
--stress_environments (environment for every instruction)
type: bool default: false
--deopt_every_n_times (deoptimize every n times a deopt point is passed)
type: int default: 0
--trap_on_deopt (put a break point before deoptimizing)
type: bool default: false
--deoptimize_uncommon_cases (deoptimize uncommon cases)
type: bool default: true
--polymorphic_inlining (polymorphic inlining)
type: bool default: true
--use_osr (use on-stack replacement)
type: bool default: true
--trace_osr (trace on-stack replacement)
type: bool default: false
--stress_runs (number of stress runs)
type: int default: 0
--optimize_closures (optimize closures)
type: bool default: true
--debug_code (generate extra code (assertions) for debugging)
type: bool default: false
--code_comments (emit comments in code disassembly)
type: bool default: false
--peephole_optimization (perform peephole optimizations in assembly code)
type: bool default: true
--enable_sse2 (enable use of SSE2 instructions if available)
type: bool default: true
--enable_sse3 (enable use of SSE3 instructions if available)
type: bool default: true
--enable_sse4_1 (enable use of SSE4.1 instructions if available)
type: bool default: true
--enable_cmov (enable use of CMOV instruction if available)
type: bool default: true
--enable_rdtsc (enable use of RDTSC instruction if available)
type: bool default: true
--enable_sahf (enable use of SAHF instruction if available (X64 only))
type: bool default: true
2012-02-19 05:36:34 +08:00
--enable_vfp3 (enable use of VFP3 instructions if available - this implies enabling ARMv7 instructions (ARM only))
2011-02-20 12:56:20 +08:00
type: bool default: true
--enable_armv7 (enable use of ARMv7 instructions if available (ARM only))
type: bool default: true
2012-02-19 05:36:34 +08:00
--enable_fpu (enable use of MIPS FPU instructions if available (MIPS only))
type: bool default: true
2011-02-20 12:56:20 +08:00
--expose_natives_as (expose natives in global object)
type: string default: NULL
--expose_debug_as (expose debug in global object)
type: string default: NULL
--expose_gc (expose gc extension)
type: bool default: false
--expose_externalize_string (expose externalize string extension)
type: bool default: false
--stack_trace_limit (number of stack frames to capture)
type: int default: 10
--disable_native_files (disable builtin natives files)
type: bool default: false
--inline_new (use fast inline allocation)
type: bool default: true
--stack_trace_on_abort (print a stack trace if an assertion failure occurs)
type: bool default: true
--trace (trace function calls)
type: bool default: false
--mask_constants_with_cookie (use random jit cookie to mask large constants)
type: bool default: true
--lazy (use lazy compilation)
type: bool default: true
--trace_opt (trace lazy optimization)
type: bool default: false
--trace_opt_stats (trace lazy optimization statistics)
type: bool default: false
--opt (use adaptive optimizations)
type: bool default: true
--opt_eagerly (be more eager when adaptively optimizing)
type: bool default: false
--always_opt (always try to optimize functions)
type: bool default: false
--prepare_always_opt (prepare for turning on always opt)
type: bool default: false
--deopt (support deoptimization)
type: bool default: true
--trace_deopt (trace deoptimization)
type: bool default: false
--min_preparse_length (minimum length for automatic enable preparsing)
type: int default: 1024
--always_full_compiler (try to use the dedicated run-once backend for all code)
type: bool default: false
--trace_bailout (print reasons for falling back to using the classic V8 backend)
type: bool default: false
--compilation_cache (enable compilation cache)
type: bool default: true
2012-02-19 05:36:34 +08:00
--cache_prototype_transitions (cache prototype transitions)
type: bool default: true
2011-02-20 12:56:20 +08:00
--trace_debug_json (trace debugging JSON request/response)
type: bool default: false
--debugger_auto_break (automatically set the debug break flag when debugger commands are in the queue)
type: bool default: true
--enable_liveedit (enable liveedit experimental feature)
type: bool default: true
--stack_size (default size of stack region v8 is allowed to use (in KkBytes))
type: int default: 1024
--max_stack_trace_source_length (maximum length of function source code printed in a stack trace.)
type: int default: 300
--always_inline_smi_code (always inline smi code in non-opt code)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
--gc_global (always perform global GCs)
type: bool default: false
--gc_interval (garbage collect after <n> allocations)
type: int default: -1
--trace_gc (print one trace line following each garbage collection)
type: bool default: false
--trace_gc_nvp (print one detailed trace line in name=value format after each garbage collection)
type: bool default: false
--print_cumulative_gc_stat (print cumulative GC statistics in name=value format on exit)
type: bool default: false
--trace_gc_verbose (print more details following each garbage collection)
type: bool default: false
--collect_maps (garbage collect maps from which no objects can be reached)
type: bool default: true
--flush_code (flush code that we expect not to use again before full gc)
type: bool default: true
--use_idle_notification (Use idle notification to reduce memory footprint.)
type: bool default: true
--use_ic (use inline caching)
type: bool default: true
--native_code_counters (generate extra code for manipulating stats counters)
type: bool default: false
--always_compact (Perform compaction on every full GC)
type: bool default: false
--never_compact (Never perform compaction on full GC - testing only)
type: bool default: false
2012-02-19 05:36:34 +08:00
--cleanup_code_caches_at_gc (Flush inline caches prior to mark compact collection and flush code caches in maps during mark compact cycle.)
2011-02-20 12:56:20 +08:00
type: bool default: true
--random_seed (Default seed for initializing random generator (0, the default, means to use system random).)
type: int default: 0
--canonicalize_object_literal_maps (Canonicalize maps for object literals.)
type: bool default: true
--use_big_map_space (Use big map space, but don't compact if it grew too big.)
type: bool default: true
--max_map_space_pages (Maximum number of pages in map space which still allows to encode forwarding pointers. That's actually a constant, but it's useful to control it with a flag for better testing.)
type: int default: 65535
--h (print this message)
type: bool default: false
--new_snapshot (use new snapshot implementation)
type: bool default: true
--use_verbose_printer (allows verbose printing)
type: bool default: true
--allow_natives_syntax (allow natives syntax)
type: bool default: false
--strict_mode (allow strict mode directives)
type: bool default: true
--trace_sim (Trace simulator execution)
type: bool default: false
--check_icache (Check icache flushes in ARM simulator)
type: bool default: false
--stop_sim_at (Simulator stop after x number of instructions)
type: int default: 0
--sim_stack_alignment (Stack alingment in bytes in simulator (4 or 8, 8 is default))
type: int default: 8
--trace_exception (print stack trace when throwing exceptions)
type: bool default: false
--preallocate_message_memory (preallocate some memory to build stack traces.)
type: bool default: false
2012-02-19 05:36:34 +08:00
--randomize_hashes (randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed))
type: bool default: true
--hash_seed (Fixed seed to use to hash property keys (0 means random)(with snapshots this option cannot override the baked-in seed))
type: int default: 0
2011-02-20 12:56:20 +08:00
--preemption (activate a 100ms timer that switches between V8 threads)
type: bool default: false
--regexp_optimization (generate optimized regexp code)
type: bool default: true
--regexp_entry_native (use native code to enter regexp)
type: bool default: true
--testing_bool_flag (testing_bool_flag)
type: bool default: true
--testing_int_flag (testing_int_flag)
type: int default: 13
--testing_float_flag (float-flag)
type: float default: 2.500000
--testing_string_flag (string-flag)
type: string default: Hello, world!
--testing_prng_seed (Seed used for threading test randomness)
type: int default: 42
--testing_serialization_file (file in which to serialize heap)
type: string default: /tmp/serdes
--help (Print usage message, including flags, on console)
type: bool default: true
--dump_counters (Dump counters on exit)
type: bool default: false
--debugger (Enable JavaScript debugger)
type: bool default: false
--remote_debugger (Connect JavaScript debugger to the debugger agent in another process)
type: bool default: false
--debugger_agent (Enable debugger agent)
type: bool default: false
--debugger_port (Port to use for remote debugging)
type: int default: 5858
--map_counters (Map counters to a file)
2012-02-19 05:36:34 +08:00
type: string default:
2011-02-20 12:56:20 +08:00
--js_arguments (Pass all remaining arguments to the script. Alias for "--".)
2012-02-19 05:36:34 +08:00
type: arguments default:
2011-02-20 12:56:20 +08:00
--debug_compile_events (Enable debugger compile events)
type: bool default: true
--debug_script_collected_events (Enable debugger script collected events)
type: bool default: true
--gdbjit (enable GDBJIT interface (disables compacting GC))
type: bool default: false
--gdbjit_full (enable GDBJIT interface for all code objects)
type: bool default: false
--gdbjit_dump (dump elf objects with debug info to disk)
type: bool default: false
2012-02-19 05:36:34 +08:00
--gdbjit_dump_filter (dump only objects containing this substring)
type: string default:
--enable_slow_asserts (enable asserts that are slow to execute)
type: bool default: false
--trace_codegen (print name of functions for which code is generated)
type: bool default: false
--print_source (pretty print source code)
type: bool default: false
--print_builtin_source (pretty print source code for builtins)
type: bool default: false
--print_ast (print source AST)
type: bool default: false
--print_builtin_ast (print source AST for builtins)
type: bool default: false
--print_json_ast (print source AST as JSON)
type: bool default: false
--print_builtin_json_ast (print source AST for builtins as JSON)
type: bool default: false
--stop_at (function name where to insert a breakpoint)
type: string default:
--verify_stack_height (verify stack height tracing on ia32)
type: bool default: false
--print_builtin_scopes (print scopes for builtins)
type: bool default: false
--print_scopes (print scopes)
type: bool default: false
--trace_contexts (trace contexts operations)
type: bool default: false
--gc_greedy (perform GC prior to some allocations)
type: bool default: false
--gc_verbose (print stuff during garbage collection)
type: bool default: false
--heap_stats (report heap statistics before and after GC)
type: bool default: false
--code_stats (report code statistics after GC)
type: bool default: false
--verify_heap (verify heap pointers before and after GC)
type: bool default: false
--print_handles (report handles after GC)
type: bool default: false
--print_global_handles (report global handles after GC)
type: bool default: false
--trace_ic (trace inline cache state transitions)
type: bool default: false
--trace_normalization (prints when objects are turned into dictionaries.)
type: bool default: false
--trace_lazy (trace lazy compilation)
type: bool default: false
--debug_serialization (write debug information into the snapshot.)
type: bool default: false
--collect_heap_spill_statistics (report heap spill statistics along with heap_stats (requires heap_stats))
type: bool default: false
--trace_isolates (trace isolate state changes)
type: bool default: false
--log_state_changes (Log state changes.)
type: bool default: false
--regexp_possessive_quantifier (enable possessive quantifier syntax for testing)
type: bool default: false
--trace_regexp_bytecodes (trace regexp bytecode execution)
type: bool default: false
--trace_regexp_assembler (trace regexp macro assembler calls.)
type: bool default: false
2011-02-20 12:56:20 +08:00
--log (Minimal logging (no API, code, GC, suspect, or handles samples).)
type: bool default: false
--log_all (Log all events to the log file.)
type: bool default: false
--log_runtime (Activate runtime system %Log call.)
type: bool default: false
--log_api (Log API events to the log file.)
type: bool default: false
--log_code (Log code events to the log file without profiling.)
type: bool default: false
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--log_handles (Log global handle events.)
type: bool default: false
--log_snapshot_positions (log positions of (de)serialized objects in the snapshot.)
type: bool default: false
--log_suspect (Log suspect operations.)
type: bool default: false
--prof (Log statistical profiling information (implies --log-code).)
type: bool default: false
--prof_auto (Used with --prof, starts profiling automatically)
type: bool default: true
--prof_lazy (Used with --prof, only does sampling and logging when profiler is active (implies --noprof_auto).)
type: bool default: false
--prof_browser_mode (Used with --prof, turns on browser-compatible mode for profiling.)
type: bool default: true
--log_regexp (Log regular expression execution.)
type: bool default: false
--sliding_state_window (Update sliding state window counters.)
type: bool default: false
--logfile (Specify the name of the log file.)
type: string default: v8.log
--ll_prof (Enable low-level linux profiler.)
type: bool default: false
2012-02-19 05:36:34 +08:00
--print_code_stubs (print code stubs)
type: bool default: false
--print_code (print generated code)
type: bool default: false
--print_opt_code (print optimized code)
type: bool default: false
--print_unopt_code (print unoptimized code before printing optimized code based on it)
type: bool default: false
--print_code_verbose (print more information for code)
type: bool default: false
--print_builtin_code (print generated code for builtins)
type: bool default: false
2011-02-20 12:56:20 +08:00
.SH RESOURCES AND DOCUMENTATION
See the website for documentation http://nodejs.org/
Mailing list: http://groups.google.com/group/nodejs
IRC: irc.freenode.net #node.js