kiddo
Call external processes and consume them as a Future-wrapped value. This is a light wrapper around execa
, so please see execa (opens in a new tab)'s documentation for more info.
execWithConfig
Consume external commands as a Future-wrapped value.
Usage
import { execWithConfig } from 'kiddo'
import { fork } from 'fluture'
fork(console.warn)(console.log)(
execWithConfig(
function customCancellationFunction() {},
'echo',
{ cleanup: true },
['ahoy']
)
)
See also
- execWithCancel
- exec
execWithCancel
Consume external commands as a Future-wrapped value.
Usage
import { execWithCancel } from 'kiddo'
import { fork } from 'fluture'
fork(console.warn)(console.log)(
execWithCancel(
function customCancellationFunction() {},
'echo',
['ahoy']
)
)
See also
- execWithConfig
- exec
exec
Consume external commands as a Future-wrapped value.
Usage
import { fork } from 'fluture'
// drgen-import-above
const blah = Math.round(Math.random() * 100000)
fork(done)(z => {
expect(z.stdout).toEqual('' + blah)
done()
})(exec('echo', [blah]))
See also
- execWithConfig
- execWithCancel
signal
Add an ora
indicator to a Future
Usage
import { signal } from 'kiddo'
import { pipe, map } from 'ramda'
import { readFile } from 'file-system'
const cancel = () => {}
pipe(
signal(cancel, { text: 'Reading file...', successText: 'Read file!'}),
map(JSON.parse),
fork(done)(raw => {
expect(raw.name).toEqual('kiddo')
done()
})
)(readFile('./package.json'))