Skip to Content
Learning Node.js Development
book

Learning Node.js Development

by Andrew Mead
January 2018
Beginner
658 pages
13h 10m
English
Packt Publishing
Content preview from Learning Node.js Development

Adding support to the read and remove commands

On the next line, I'll call .command again, passing in the command name. Let's do the list command first because this one is really easy, no arguments are required. Then we'll pass in the description for the list command, List all notes, as shown here:

.command('list', 'List all notes').help().argv;

Next up, we'll call command again. This time we'll do the command for read. The read command reads an individual note, so for the description for the read command, we'll use something like Read a note:

.command('list', 'List all notes').command('read', 'Read a note').help().argv;

Now the read command does require the title argument. That means we are going to need to provide that options object. I'll ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Node.js Development

Advanced Node.js Development

Andrew Mead
Node.js: Tools & Skills, 2nd Edition

Node.js: Tools & Skills, 2nd Edition

James Hibbard, Michael Wanyoike, Nilson Jacques, Jay Raj, Manjunath M
Your First Week With Node.js, 2nd Edition

Your First Week With Node.js, 2nd Edition

James Hibbard, Craig Buckler, Mark Brown, Nilson Jacques, James Kolce, Paul Orac, M. David Green, Florian Rappl

Publisher Resources

ISBN: 9781788395540Supplemental Content