Created
April 11, 2025 14:15
-
-
Save imesut/b413b6fb802bcf3cca0dcc297a1d24a6 to your computer and use it in GitHub Desktop.
Base64 to File convert with Node
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
| // import * as fs from 'fs'; | |
| const fs = require('fs'); | |
| const merged = fs.readFileSync("pdf.b64", "utf-8"); | |
| const decoded = Buffer.from(merged, "base64"); | |
| console.log("original: " + merged.length); | |
| console.log("decoded: " + decoded.length); | |
| fs.writeFileSync("pdf.pdf", decoded); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment