Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the node command do with the -e argument passed

Tags:

node.js

When I put node -e "some argument string" into the command line, what does it do? I cant seem to find any documentation on this from google and stackoverflow searches.

like image 447
Daniel Kobe Avatar asked Aug 27 '26 03:08

Daniel Kobe


1 Answers

It evaluates the script argument

node -e "console.log('test')"
> test

You can can get help and info by running...

node -h

Or:

node --help
like image 173
undefined Avatar answered Aug 28 '26 17:08

undefined