The design goal of this package is to make simple things simple. Making hard things possible is not one of the goals.
Usage:
main(module, async () => {
// ... Script code
});
Script code will be executed when running module directly, but will not be executed
when importing module. As a bonus it's easy to use await
in the script code.
Future: parsing args and passing them into callback.
Basically console.log
with small improvements: returns first argument as a result (making debugging easier, e.g.
run(print(getCommand()), print(getOptions()))
). Also, when called with one argument, uses 99
for util.inspect
depth instead of the default.
Essentially promisified exec
from 'child_process'
, but with significant differences:
- takes one string or array of strings as first argument and no second argument
- returns concatenation stderr and stdout encoded to
utf8
- when first argument is array, commands are executed sequentially and result is array
- new lines are stripped from command text
Essentially execSync
from 'child_process'
, but with some differences:
- takes one string or array of strings as first argument and no second argument
- stdio is only in
'inherit'
mode - prints command before execution
- always returns
undefined
Reexport from 'node-fetch'
.
Reexport from 'fs-extra'
.
Reads from value from environment, undefined returned as empty string.
Reads from value from environment converting it to boolean.
Reads from value from environment converting it to number.