Skip to content
Myr

pm

This file

Path

examples/pm

33 lines · 1.1 KiB

Last changed by

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

History of this file

Take it

The walk stopped after 200 commits: lines older than 2aad525 point at it.

Update dependencies (#1214)John Geebefore adoption2aad525

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

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 3–5why, one step back
3// const { Command } = require('commander'); // (normal include)
4const { Command } = require('../'); // include commander in git clone of commander repo5const program = new Command();

Update dependencies (#1214)John Geebefore adoption2aad525

line 6why, one step back
6

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

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

Update dependencies (#1214)John Geebefore adoption2aad525

line 14why, one step back
14program

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

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

Update dependencies (#1214)John Geebefore adoption2aad525

lines 16–19why, one step back
16 .version('0.0.1')
17 .description('Fake package manager')18 .command('install [name]', 'install one or more packages').alias('i')19 .command('search [query]', 'search with optional query').alias('s')

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 20–21why, one step back
20 .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' })
21 .command('list', 'list packages installed', { isDefault: true });

Update dependencies (#1214)John Geebefore adoption2aad525

line 22why, one step back
22

Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b

lines 23–24why, one step back
23program.parse(process.argv);
24

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

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

Update dependencies (#1214)John Geebefore adoption2aad525

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

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

lines 29–33why, one step back
29// node pm
30// node pm help install31// node pm install -h32// node pm install foo bar baz33// node pm install foo bar baz --force