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

The walk stopped after 200 commits: lines older than 471ec40 point at it.

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 1–2why, one step back
1#!/usr/bin/env node
2

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

line 3why, one step back
3import { Command } from 'commander';

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 4–5why, one step back
4const program = new Command();
5

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 6why, one step back
6program.option('-f, --force', 'force installation');

Update README and examples for allowExcessArguments change (#2266)John Geebefore adoption2c9051a

line 7why, one step back
7program.argument('[package-names...]');

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 8–19why, one step back
8
9program.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');

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 20why, one step back
20pkgs.forEach(function (pkg) {

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 21–23why, one step back
21 console.log(' install : %s', pkg);
22});23console.log();