-
Notifications
You must be signed in to change notification settings - Fork 8
Refactor(js-ciphers): export Vigenère as ESM module + package.json + example #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor(js-ciphers): export Vigenère as ESM module + package.json + example #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the JavaScript Vigenère cipher implementation into a reusable ESM module by separating the test code from the module itself, adding proper Node.js package configuration, and providing standalone example usage.
Key changes:
- Removed inline test code from
vigenere.jsto keep it as a pure exportable module - Created
test.jswith example usage demonstrating encryption/decryption - Added
package.jsonwith ESM configuration to enable proper Node module support
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| js-ciphers/vigenere.js | Removed inline test code and added explanatory comments about ESM exports |
| js-ciphers/test.js | New file with example usage demonstrating the Vigenère cipher |
| js-ciphers/package.json | New package configuration enabling ESM module support |
| README.md | Formatting changes including emoji removal and indentation adjustments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
js-ciphers/package.json
Outdated
| "description": "Collection of small JavaScript cipher utilities (Vigenere)", | ||
| "main": "vigenere.js", | ||
| "type": "module", | ||
| "keywords": ["cipher", "vigenere", "cryptography", "ciphers"], |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keyword 'vigenere' should be spelled 'vigenère' (with accent) for consistency and correctness.
| "description": "Collection of small JavaScript cipher utilities (Vigenere)", | |
| "main": "vigenere.js", | |
| "type": "module", | |
| "keywords": ["cipher", "vigenere", "cryptography", "ciphers"], | |
| "description": "Collection of small JavaScript cipher utilities (Vigenère)", | |
| "main": "vigenere.js", | |
| "type": "module", | |
| "keywords": ["cipher", "vigenère", "cryptography", "ciphers"], |
|
|
||
| ## 🧰 What's Inside? | ||
| ## What's Inside? | ||
|
|
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire header section (title through 'What's Inside?') is duplicated on lines 30-52. Additionally, the code block starting at line 25 is incomplete and cuts off at line 29, followed by the duplicate content. Remove the duplicate lines 30-52 and complete the directory tree structure properly.
| **Important**: Save the key and IV - you'll need them to decrypt! | ||
| #### CLI Mode - File Decryption | ||
| ## CLI Mode - File Decryption |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect heading level. This should be ### (level 3) to match the preceding 'CLI Mode - File Encryption' section structure, not ## (level 2).
| ## CLI Mode - File Decryption | |
| #### CLI Mode - File Decryption |
| ## License | ||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
| --- | ||
| ## Show Your Support | ||
| Give us a star if you found this helpful! |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Contributing, License, and Show Your Support sections are duplicated. These lines duplicate content already present on lines 187-201. Remove this duplicate content.
| ## License | |
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | |
| --- | |
| ## Show Your Support | |
| Give us a star if you found this helpful! |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Refactors the existing JavaScript Vigenère implementation into a reusable Node ESM package under js-ciphers/