Skip to content

Instantly share code, notes, and snippets.

@joutvhu
Created June 20, 2021 09:38
Show Gist options
  • Save joutvhu/5b509cf458ecdeff01fd43557f8e066a to your computer and use it in GitHub Desktop.
Save joutvhu/5b509cf458ecdeff01fd43557f8e066a to your computer and use it in GitHub Desktop.
  • Create a get-base64.js file with the content as below
const fs = require('fs');

console.log(fs.readFileSync(
	'<file path>',
	{encoding: 'base64'}
));
  • Run the following command
node get-base64.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment