EN
TypeScript / Node.js - convert base64 to string
0 points
In this article, we would like to show you how to convert Base64 to string in TypeScript.
In this example, we decode a string of data that has been encoded using Base64 encoding.
xxxxxxxxxx
1
const encoded: string = 'c29tZSB0ZXh0Li4u';
2
const decoded: string = Buffer.from(encoded, 'base64').toString('utf8');
3
4
console.log('Decoded text: ' + decoded);
Output:
xxxxxxxxxx
1
Decoded text: some text...