Open brettz9 opened 6 years ago
Or maybe the issue is due to this not having published to npm...
Oh, and the README should not refer to require('TextDecoderLite')
but require('text-decoder-lite')
I was just wondering why import { TextEncoderLite } from 'text-encoder-liter'
is not working and discovered that those last lines are not in my npm-installed version.
It has only:
if(typeof module === "object" && module) {
module.exports = TextDecoderLite
}
Yes, this is a bug... it's very surprising to do import TextEncoderLite from 'text-encoder-lite'
and get something which doesn't have an encode method :).
It's also suprising to do const TextEncoderLite = require('text-encoder-lite').TextEncoderLite
and get undefined, because it still returns just TextDecorerLite.
EDIT: this should be resolved by https://github.com/coolaj86/TextEncoderLite/pull/10 But no releases yet :(
@himdel would this PR (https://github.com/coolaj86/TextEncoderLite/pull/12/commits/23d8624b8a3e7d27b7bb55e06733eeecb1e0e19f) resolve the issue?
@Ruffio : That commit was only for the README... All that should need to be done to fix this is for the author to do a npm publish
...
https://github.com/coolaj86/TextEncoderLite/blob/e1e031b4a7fb89c35629340a61a06ec4f50ce7cb/text-encoder-lite.js#L137-L143
The last line in the block is erasing the previous so only
TextDecoderLite
is exported for Node.