diff --git a/notes.js b/notes.js index df64a18..5cd1a57 100644 --- a/notes.js +++ b/notes.js @@ -45,8 +45,13 @@ function main() { console.log(ok ? `Deleted note #${id}` : `No note #${id} found`); break; } + case "count": { + const n = store.all().length; + console.log(`You have ${n} note${n === 1 ? "" : "s"}.`); + break; + } default: - console.log("Commands: add | list | search | delete "); + console.log("Commands: add | list | search | delete | count"); console.log(`(Session locks after ${config.SESSION_TIMEOUT_MINUTES} minutes of inactivity.)`); } }