Create a small base64-encoded string representation of an image.
npm i -D @bicycle-codes/stringify
This writes to stdout
. Use shell redirection to write to a file, etc.
npx stringify ./my-file.jpeg > base64.txt
On macos, this will copy the output to the OS clipboard
npx stringify ./my-file.jpeg | pbcopy