Transforms an options object into a process.argv-like array for use with child_process.spawn. Current stable version is 1.0.0, last released in 2014. Unlike minimist (which parses argv into an object), argv-formatter does the reverse: converts an object of options into an array of arguments. Handles boolean flags, stringified values, and '_' for positional arguments. Minimal dependencies, no updates for over a decade, but stable for its narrow purpose.
npm install argv-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates converting an options object to argv array, then using it with child_process.spawn.
Format values to strings before passing to format().
Explicitly check if a value should be included, e.g., use { verbose: true } instead of conditional.const { format } = require('argv-formatter');Consider using a modern alternative like yargs-parser's unparse or building your own with simpler logic.
const { format } = require('argv-formatter'); const args = format({...});Use named import: import { format } from 'argv-formatter';Use exec or shell option in child_process for glob expansion, or pass array of filenames.
No dependency data recorded yet.