Created
August 18, 2025 10:02
-
-
Save faceless2/ee30d76e223bdc2de51e8c54d7d9a4b9 to your computer and use it in GitHub Desktop.
Base64 encode buffers when they are serialized in JSON
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
| It's a simple one-liner - add this to your code, just be aware it impacts ALL buffers | |
| Buffer.prototype.toJSON = function() { return this.toString("base64"); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment