Process.escapeCliOpt()

Escape a value for use as a command-line option (e.g. the "XXXXX" in `--foobar='XXXXX'`).

When using the escaped result returned from this method, make sure to wrap it in single quotes when building up the final CLI options string. For instance `--foo='RESULT_FROM_THIS_MACHINE_HERE'` or `-f 'RESULT_FROM_THIS_MACHINE_HERE'

Usage

Hover over inputs/exits for more info.

var Process = require('machinepack-process');


// Escape a value for use as a command-line option (e.g. the "XXXXX" in `--foobar='XXXXX'`).

Process.escapeCliOpt({

value: '*',

}).execSync();

Inputs

value required

The value to escape as a CLI option.

'*'

Exits

error

An unexpected error occurred.

couldNotSerialize

The provided value could not be serialized into a JSON string.

success

OK.

'{"foo":"bar"}'