January 2018
Beginner
658 pages
13h 10m
English
Now that we have our title configured, we can do the exact same thing for the body. We'll specify our options object and provide those three arguments: describe, demand, and alias for body:
const argv = yargs .command('add', 'Add a new note', { title: { describe: 'Title of note', demand: true, alias: 't' }, body: { } }) .help() .argv;
The first one is describe and that one's pretty easy. describe is going to get set equal to a string, and in this case Body of note will get the job done:
const argv = yargs .command('add', 'Add a new note', { title: { describe: 'Title of note', demand: true, alias: 't' }, body: { describe: 'Body of note' } }) .help() .argv;
The next one will be demand, and to add a note we are going to need ...
Read now
Unlock full access