stringencoding

0.0.0 • Public • Published

stringencoding

basic usage

// encode a string into a typed array given an encoding
var uint8array = TextEncoder(encoding).encode(string);
 
// decode typed array into a string
var string = TextDecoder(encoding).decode(uint8array);

streaming decode

var string = '';
var decoder = TextDecoder(encoding), buffer;
 
while (buffer = next_chunk()) {
    string += decoder.decode(buffer, { stream:true });
}
 
string += decoder.decode(); // finish the stream

install

npm install stringencoding

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.0
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.0
    6

Package Sidebar

Install

npm i stringencoding

Weekly Downloads

5

Version

0.0.0

License

Apache License 2.0

Last publish

Collaborators

  • defunctzombie