This release modernizes restructure to drop Node-specific dependencies so it can more easily be used in the browser. With these changes, restructure now has zero dependencies.
- Add ESM support.
- Input and output is now
Uint8Array
rather thanBuffer
- Encoding drops the streaming API in favor of a
toBuffer
method. fromBuffer
is also added as a shortcut.- Legacy text encodings are now supported via
TextDecoder
, a native browser API also implemented in Node, rather thaniconv-lite
. This means only decoding is supported, not encoding, asTextEncoder
does not support legacy encodings. - Drop Node 12 support. Raise baseline to 14 (current LTS).