Skip to content

Add count command to print the number of notes - #302

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

aleekx1981-cpu wants to merge 1 commit into
mate-academy:mainfrom
aleekx1981-cpu:add-count-command

Conversation

@aleekx1981-cpu

@aleekx1981-cpu aleekx1981-cpu commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary

Adds a notes count command that prints how many notes are stored, for example you have 3 notes. It uses the singular for exactly one note (you have 1 note.). The command is also added to the help text shown when no command is given.

Changes

  • notes.js: new count case that prints store.all().length, plus count added to the default help line.

Testing

  • Ran node notes.js count with an empty store. It printed you have 0 notes.
  • Ran npm test. All 3 existing tests pass.
  • No new tests are included. The existing tests only cover matches in lib/store.js, and notes.js runs main() on import, so the CLI isn't covered.

For reviewers

  • Wording: the output starts lowercase ("you have…") to match the requested format. Say so if you'd prefer it capitalized.
  • Singular and plural: the output switches between "note" and "notes", so count with exactly one note is worth checking.
  • Zero notes: count prints you have 0 notes. rather than the "No notes yet" hint that list shows. This looks consistent with the request, but it's a judgment call.
  • No tests: if you want count covered, the logic would need to move into lib/store.js or a function that can be imported without running the CLI.
  • Scope: package-lock.json is untracked locally and isn't part of this PR.

Prints how many notes exist, e.g. "you have 3 notes."

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution is approved. The implementation successfully adds the count command to the notes tool as required. All core functionality is present: add, list, search, delete, and the new count command all work as specified. The code correctly handles singular/plural forms ("1 note" vs "2 notes") and uses lowercase output consistent with the existing app style. The help text has been properly updated to include the new command in the list of available commands. No critical issues were identified - the implementation follows the existing code patterns and meets all checklist requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example ↩

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.

3 participants