Tips &Tricks

0

How to run cli/unix commands from nodejs scripts?

There are two ways to do this: child_process.exec(command[, options][, call­back]) // ls.js const { exec } = require(‘child_process’); exec(‘ls –lh /usr’, (error, std­out, stderr) => { if (error) { console.error(‘exec error: ${error}‘); return; } console.log(‘stdout:…

0

What does ip address 0.0.0.0 mean?

The first time I saw that addres I was a bit con­fused. I used to think that 127.0.0.1 was the only way to refer to your local machine. Turns out, 0.0.0.0 is another way…