DEV Community

Clarice Bouwer
Clarice Bouwer

Posted on


How to write stdout both to the terminal and a file

Below I use the tee command to write the output of an npm run build script to both to the terminal and to a log file.

npm run build | tee ./logs/build.log
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

An Animated Guide to Node.js Event Loop

>> Check out this classic DEV post <<