1.0.0 • Published 4 years ago
text-coder v1.0.0
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)
1.0.0
4 years ago