Open Bizarrus opened 6 years ago
Try const TextEncoder = require('text-encoding').TextEncoder;
Nope, it will create an Exception: ReferenceError: TextEncoder is not defined
.
Same with Decoder.
I strongly regret ever adding npm/package/module support. This is a client-side polyfill, and more a reference implementation than anything intended for production use.
Fixes welcome that don't break the non-module approach.
By the sample (https://github.com/inexorabletash/text-encoding#api-overview) i try to use these module.
But i can't insert your module to run it.
const TextEncoder = require('text-encoding'); message = new TextEncoder("utf-8").encode(message);
Is it only a clientside module or a serverside module? No informations given. Bad docs.