exec(name, arguments)

Executes any CLI command in the current working directory. This example demonstrates the logic for extracting the name and arguments of a sample CLI command: npm i -g codemod translates to exec('npm', ['i', '-g', 'codemod']). Here are some examples in real scenarios.

Parameters

name
string
required

Command name.

arguments
string[]

Arguments passed to command.

Returns