- 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
get-base64.js
file with the content as belowconst fs = require('fs');
console.log(fs.readFileSync(
'<file path>',
{encoding: 'base64'}
));
node get-base64.js