node -e 'console.log(process.version)'

Category: Node.js & npm/yarn

node -e 'console.log(process.version)'

Execute a one-liner JavaScript expression directly from the terminal without a file

Runs a JavaScript one-liner directly in the terminal without needing a file. -e means 'evaluate this string as code'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.