Skip to content

Node.jsにコマンドラインオプションを渡す方法

基本的には nodets-node コマンドに渡す。

Terminal window
node --require file.js
ts-node --require file.ts

NODE_OPTIONS 環境変数を使っても渡せる。

Terminal window
export NODE_OPTIONS='--require file.js'
node