Run CLI commands and return output as string
npm install said
const said = require("said")
said("node -v") // "v8.3.0"
said("npm -v") // "v5.6.0"
if (said("git diff")) {
said("git add .")
}
- Runs synchronously
- Returns a trim string
- Buffers or other outputs convert to string
- Trims the output string before returning