node-shell
node-shell copied to clipboard
Add the `stringify` method
Add the stringify method, documentation and tests.
The method converts an array, which is result of the compile method, to a CLI command string. For example:
If the Parameters config is:
{
commands: {
'start': {
options: {
'myparam': {}
} } } }
The script like this:
parameters(config).stringify({
command: 'start',
myparam: 'my value'
})
will output this:
process.execPath ./bin/myscript start --myparam ‘my value'
I dont understand, is it exactly what stringify (soon to be called compile) method is doing ? Stringify, in its new version shall return a string, not an array.
Forgot to change copy paste. Changed