safer-text
v0.1.2
Published
A safer encode and decode from TextEncoder and TextDecoder.
Downloads
19
Maintainers
Readme
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