Author: Kavit


How to run cpplint on recursively on multiple folders?

You can specify path to both the directories as arguments. In this example, they are specified as srcFiles and appFiles. const cppLint = path.resolve(“”); // get the path to const srcFiles = path.resolve(__dirname,...


Debug mocha using visual studio code

Add the following configuration in your launch.json { “name”: “Run mocha”, “type”: “node”, “request”: “launch”, “program”: “${workspaceRoot}/node_modules/mocha/bin/mocha”, “stopOnEntry”: false, “args”: [ “test/**/*.js”, “–inspect”, “–debug-brk”, “–no-timeouts” ], “cwd”: “${workspaceRoot}”, “runtimeExecutable”: null, “env”: { “NODE_ENV”: “testing”...


How to run cli/unix commands from nodejs scripts?

There are two ways to do this: child_process.exec(command[, options][, callback]) // ls.js const { exec } = require(‘child_process’); exec(‘ls -lh /usr’, (error, stdout, stderr) => { if (error) { console.error(`exec error: ${error}`); return; }...