Ecosystem bridges · BUILT-IN MODULE

node

Node.js, npm, and npx bridge.

Quick start

use node
use node

say try node.version
output = try node.eval "console.log(21 * 2)"
say output

API reference

node.version

Return Node.js version. Fallible.

回傳 Node.js version. 此操作可能失敗。
node.run file

Run a Node.js file. Fallible.

執行 a Node.js file. 此操作可能失敗。
node.output file

Run Node.js and capture output. Fallible.

執行 Node.js and capture output. 此操作可能失敗。
node.eval code

Evaluate JavaScript with Node.js. Fallible.

執行並取得結果 JavaScript with Node.js. 此操作可能失敗。
node.npm args

Run npm arguments. Fallible.

執行 npm arguments. 此操作可能失敗。
node.npx args

Run npx arguments. Fallible.

執行 npx arguments. 此操作可能失敗。