Skip to content
Myr

pm-install

This file

Path

examples/pm-install

23 lines · 483 bytes

Last changed by

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

History of this file

Take it

1#!/usr/bin/env node23import { Command } from 'commander';4const program = new Command();56program.option('-f, --force', 'force installation');7program.argument('[package-names...]');89program.parse(process.argv);1011const pkgs = program.args;1213if (!pkgs.length) {14  console.error('packages required');15  process.exit(1);16}1718console.log();19if (program.opts().force) console.log('  force: install');20pkgs.forEach(function (pkg) {21  console.log('  install : %s', pkg);22});23console.log();