Skip to content
Myr

pm

This file

Path

examples/pm

32 lines · 1.0 KiB

Last changed by

Use standard import in examples (#2168)John Geebefore adoption41b12cf

History of this file

Take it

The walk stopped after 200 commits: lines older than 0b0fbbe point at it.

Update dependencies (#1524)John Geebefore adoption0b0fbbe

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

Use standard import in examples (#2168)John Geebefore adoption41b12cf

line 3why, one step back
3const { Command } = require('commander');

Update dependencies (#1524)John Geebefore adoption0b0fbbe

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

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

lines 6–12why, one step back
6// Example of subcommands which are implemented as stand-alone executable files.
7//8// When `.command()` is invoked with a description argument,9// this tells Commander that you're going to use a stand-alone executable for the subcommand.10//11// Only `install` and `list` are implemented, see pm-install and pm-list.js12

Update dependencies (#1524)John Geebefore adoption0b0fbbe

line 13why, one step back
13program

Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c

line 14why, one step back
14 .name('pm')

Update dependencies (#1524)John Geebefore adoption0b0fbbe

lines 15–23why, one step back
15 .version('0.0.1')
16 .description('Fake package manager')17 .command('install [name]', 'install one or more packages').alias('i')18 .command('search [query]', 'search with optional query').alias('s')19 .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' })20 .command('list', 'list packages installed', { isDefault: true });2122program.parse(process.argv);23

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

lines 24–26why, one step back
24// Try the following on macOS or Linux:
25// ./examples/pm26//

Update dependencies (#1524)John Geebefore adoption0b0fbbe

line 27why, one step back
27// Try the following:

Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36

lines 28–32why, one step back
28// node pm
29// node pm help install30// node pm install -h31// node pm install foo bar baz32// node pm install foo bar baz --force