diff --git a/notes.js b/notes.js index df64a18..2f316ef 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 notes = store.all(); + console.log(`${notes.length} note${notes.length === 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.)`); } }