diff --git a/notes.js b/notes.js index df64a18..5993794 100644 --- a/notes.js +++ b/notes.js @@ -39,6 +39,11 @@ function main() { } break; } + case "count": { + const n = store.all().length; + console.log(`You have ${n} note${n === 1 ? "" : "s"}.`); + break; + } case "delete": { const id = Number(rest[0]); const ok = store.remove(id); @@ -46,7 +51,7 @@ function main() { break; } default: - console.log("Commands: add | list | search | delete "); + console.log("Commands: add | list | count | search | delete "); console.log(`(Session locks after ${config.SESSION_TIMEOUT_MINUTES} minutes of inactivity.)`); } }