try-exec
v1.1.4
Published
<p align="center"> <img src="tryexec.png" width="250" /> </p>
Downloads
3
Readme
Install
npm install -D try-exec
# or
yarn add --dev try-exec
Usage
const tryExec = require('try-exec')
const isReachable = require('is-reachable')
tryExec({
script: 'gatsby develop',
// Check if API is reachable
check: async () => await isReachable('cdn.contentful.com'),
})
API
tryExec(?options)
Options
max
Max attemps to check
type: Number
default: 3
interval
Delay between each attemp
type: Number
(ms)
default: 1500
script
CLI script to run
type: String
default: echo "Hello World"
check
(Async) function to run when checking
type: Function
default: () => false
verbose
Log when attemps, number of each iteration and results. Could be passed a string
to log.
type: Boolean|String
default: false