node-shell icon indicating copy to clipboard operation
node-shell copied to clipboard

Add the `stringify` method

Open sergkoudi opened this issue 6 years ago • 2 comments

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'

sergkoudi avatar May 13 '19 15:05 sergkoudi

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.

wdavidw avatar May 14 '19 07:05 wdavidw

Forgot to change copy paste. Changed

sergkoudi avatar May 14 '19 08:05 sergkoudi