0.1.2 • Published 7 years ago
safer-text v0.1.2
safer-text
A safer encode and decode from TextEncoder and TextDecoder.
// once imported
import {encode, decode} from 'safer-text';
const encoded = encode('something');
console.log(decode(encoded)); // something
console.log(decode(encoded, 'utf-8')); // something
console.log(decode(encoded, 'utf-8', {fatal: true})); // something