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
Uint8Arrayrather thanBuffer - Encoding drops the streaming API in favor of a
toBuffermethod. fromBufferis 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, asTextEncoderdoes not support legacy encodings. - Drop Node 12 support. Raise baseline to 14 (current LTS).