Repository navigation
Add count command to print the number of notes - #302
Open
aleekx1981-cpu wants to merge 1 commit into
Open
aleekx1981-cpu wants to merge 1 commit into
aleekx1981-cpu wants to merge 1 commit into
Conversation
Prints how many notes exist, e.g. "you have 3 notes." Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
mateacademy-ai-mentor
approved these changes
Oct 25, 2026
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
notes countcommand that prints how many notes are stored, for exampleyou 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: newcountcase that printsstore.all().length, pluscountadded to the default help line.Testing
node notes.js countwith an empty store. It printedyou have 0 notes.npm test. All 3 existing tests pass.matchesinlib/store.js, andnotes.jsrunsmain()on import, so the CLI isn't covered.For reviewers
countwith exactly one note is worth checking.countprintsyou have 0 notes.rather than the "No notes yet" hint thatlistshows. This looks consistent with the request, but it's a judgment call.countcovered, the logic would need to move intolib/store.jsor a function that can be imported without running the CLI.package-lock.jsonis untracked locally and isn't part of this PR.