| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 51d1960 commit 520369d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,13 +140,13 @@ generated output. | |||
| 140 | 140 | ||
| 141 | 141 | ```js | |
| 142 | 142 | const exec = require('child_process').exec; | |
| 143 | - const child = exec('cat *.js bad_file | wc -l', | ||
| 144 | - (error, stdout, stderr) => { | ||
| 145 | - console.log(`stdout: ${stdout}`); | ||
| 146 | - console.log(`stderr: ${stderr}`); | ||
| 147 | - if (error !== null) { | ||
| 148 | - console.log(`exec error: ${error}`); | ||
| 149 | - } | ||
| 143 | + exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => { | ||
| 144 | + if (error) { | ||
| 145 | + console.error(`exec error: ${error}`); | ||
| 146 | + return; | ||
| 147 | + } | ||
| 148 | + console.log(`stdout: ${stdout}`); | ||
| 149 | + console.log(`stderr: ${stderr}`); | ||
| 150 | 150 | }); | |
| 151 | 151 | ``` | |
| 152 | 152 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments