node

提供: Node.js/JavaScript入門
移動: 案内検索
スポンサーリンク

nodeとは、node.jsのコマンドです。つまり、JavaScriptの処理系です。プログラムはV8 JavaScriptエンジンで実行されます。

読み方

node
のーど

概要

nodeコマンドは、スクリプトファイルを指定するか、コマンドラインの引数としてワンライナープログラムを指定する方法で、プログラムを実行できます。 スクリプトファイルを実行する例です。

$ node main.js

ワンライナープログラムの例です。

$ node -e "console.log('Hello, World');"
Hello, World

ワンライナーの詳細については、node.jsにおけるワンライナーの使い方をご参照ください。

インストール

node.jsのインストールをご参照ください。

コマンドラインオプション

Usage: node [options] [ -e script | script.js ] [arguments]
       node debug script.js [arguments]
 
Options:
  -v, --version        print node's version
  -e, --eval script    evaluate script
  -p, --print          evaluate script and print result
  -i, --interactive    always enter the REPL even if stdin
                       does not appear to be a terminal
  --no-deprecation     silence deprecation warnings
  --trace-deprecation  show stack traces on deprecations
  --v8-options         print v8 command line options
  --max-stack-size=val set max v8 stack size (bytes)
 
Environment variables:
NODE_PATH              ':'-separated list of directories
                       prefixed to the module search path.
NODE_MODULE_CONTEXTS   Set to 1 to load modules in their own
                       global contexts.
NODE_DISABLE_COLORS    Set to 1 to disable colors in the REPL
 
Documentation can be found at http://nodejs.org/

関連項目




スポンサーリンク