child_process#execFile with an additional `subcommand` argument
npm install execfile-subcommand



[child_process#execFile][execfile] with an additional subcommand argument
``javascript
const execFileSubcommand = require('execfile-subcommand');
execFileSubcommand('npm', 'view', ['npm@3.0.0', 'version'], (err, stdout, stderr) => {
stdout; //=> '3.0.0\n'
});
`
``
npm install execfile-subcommand
file: String (filename of the program to run) String
subcommand: (subcommand of the root command) Array
args: of strings (arguments passed to the subcommand) Object
opts: ([child_process#execFile][execfile] options) Function
cb: (callback function) ChildProcess
Return: instance
Instead of running the root program directly as [child_process#execFile][execfile] does, it runs the given subcommand of the program specified with the second argument.
`javascript
const execFileSubcommand = require('execfile-subcommand');
execFileSubcommand('npm' 'install', ['babel'], () => {/ ... /});
// --- is almost the same script as ---
const {execFile} = require('child_process');
execFile('npm' ['install', 'babel'], () => {/ ... /});
``
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.
[execfile]: https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback