Skip to content

Add count command#15

Open
pppmppp wants to merge 1 commit into
mate-academy:mainfrom
pppmppp:add-count-command
Open

Add count command#15
pppmppp wants to merge 1 commit into
mate-academy:mainfrom
pppmppp:add-count-command

Conversation

@pppmppp

@pppmppp pppmppp commented Jun 23, 2026

Copy link
Copy Markdown

What changed

  • Added a count command to the notes CLI (node notes.js count)
  • Prints You have N note(s). with correct singular/plural handling
  • Updated the default usage line to include count

Why

Quick way to see how many notes exist without listing them all — useful when the list is long.

Test plan

  • node notes.js count with no notes → You have 0 notes.
  • Add a note, run countYou have 1 note. (singular)
  • Add another, run countYou have 2 notes. (plural)
  • npm test — all 3 existing tests pass

Reviewer notes

  • The singular/plural logic (n === 1 ? "" : "s") is simple but worth a quick look
  • No new tests were added for count — the command is a thin wrapper over store.all().length, but a test could be added if desired

🤖 Generated with Claude Code

Prints how many notes exist (with correct singular/plural).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant