text-coder
v1.0.0
Published
text-coder ====
Downloads
56
Readme
text-coder
Common interface for TextEncoder & TextDecoder. In node uses util module. In browser uses classes from global scope and shim if they are not available. Typings included.
Example
import {TextEncoder, TextDecoder} from "text-coder";
let text = "Some text";
let te = new TextEncoder();
let array = te.encode(text);
let td = new TextDecoder();
let res = td.decode(array);
console.log(text == res, text, array, res);
License
The MIT License (MIT)