pm-install
This file
Path
examples/pm-install
24 lines · 561 bytes
Last changed by
Tidy up some old examples (#1604)John Geebefore adoptionc1472bc
History of this fileTake it
1#!/usr/bin/env node23// const { Command } = require('commander'); // (normal include)4const { Command } = require('../'); // include commander in git clone of commander repo5const program = new Command();67program8 .option('-f, --force', 'force installation');910program.parse(process.argv);1112const pkgs = program.args;1314if (!pkgs.length) {15 console.error('packages required');16 process.exit(1);17}1819console.log();20if (program.opts().force) console.log(' force: install');21pkgs.forEach(function(pkg) {22 console.log(' install : %s', pkg);23});24console.log();