January 2018
Beginner
658 pages
13h 10m
English
Now, with the list command, I'll remove the console.log statement and call notes.getAll, as shown here:
console.log('Starting app.js');const fs = require('fs');const _ = require('lodash');const yargs = require('yargs');const notes = require('./notes.js');const argv = yargs.argv;var command = process.argv[2];console.log('Command:', command);console.log('Process', process.argv);console.log('Yargs', argv);if (command === 'add') { notes.addNote(argv.title, argv.body);} else if (command === 'list') { notes.getAll();} else if (command === 'read') { console.log('Reading note');} else if (command === 'remove') { console.log('Removing note');} else { console.log('Command not recognized');}
At some point, notes.getAll ...
Read now
Unlock full access