v3.0.0 - ESM and Builder pattern
Breaking changes
Native encoder API split
The native encoder API is now split into EncoderBuilder
and Encoder
, following the builder pattern. To create an encoder, use new EncoderBuilder()
and build using one of the build methods.
This change is to ensure that set
methods can only be called before initialising the encoder, and to avoid using async methods when initialised with non-async version (or viceversa).
Native decoder API split
The native decoder API is now split into DecoderBuilder
and Decoder
, following the builder pattern. To create a decoder, use new DecoderBuilder()
and build using one of the build methods.
This change is to ensure that set
methods can only be called before initialising the decoder, and to avoid using async methods when initialised with non-async version (or viceversa).
ESM module
This module is now ESM only. See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c.
Older node versions
Dropped support for node v10 and v12. N-API version is 8.
Technically, you can use this package in node 12, but no support will be given.
Updated install script
To remove outdated package prebuild
, I made a custom script that does whatever I need in order to download the pre-built package from github or to build the package locally. It has been tested under certain scenarios on macOS/Linux, but Windows is not well tested.
Raise an issue if there are problems regarding this install script.
Pre built packages
- Removed packages for
arm32v7
on Linux. - Added
arm64
package for macOS. - Added
x86
package for Windows.
Notable Changes
- Enabled LTO.
- Migrate to ESM.
- Split native
Encoder
intoEncoderBuilder
andEncoder
. - Split native
Decoder
intoDecoderBuilder
andDecoder
. - Replace
prebuild
with custom script (windows untested, it may not work). StreamDecoder
andFileDecoder
streams will not error when flac error is emitted.- Update
libFLAC
to1.4.1
.
Full Changelog: v2.7.0...v3.0.0