Skip to content

Replacements for @jsdevtools/ez-spawn

tinyexec

ez-spawn accepts shell-like command strings, which tinyexec does not.

For example:

ts
import ezSpawn from '@jsdevtools/ez-spawn'
import { x } from 'tinyexec'

await ezSpawn.async('ls -l') 
await x('ls', ['-l']) 

Alternatively, you can use args-tokenizer to convert a shell string to a command and arguments:

ts
import ezSpawn from '@jsdevtools/ez-spawn'
import { tokenizeArgs } from 'args-tokenizer'
import { x } from 'tinyexec'

const [command, ...args] = tokenizeArgs('ls -l') 
await ezSpawn.async('ls -l') 
await x(command, args) 

Released under the MIT License. (a44cbf10)