Skip to main content

Migration from v2

v3 is almost entirely additive — existing code that only uses built-in data types keeps working unchanged. There is exactly one breaking API change, plus two project-level changes you should know about.

Breaking Changes

Custom DataType decode methods renamed

DataType's decode-side members were renamed to pair with their encode* counterparts. This only matters if you registered a custom DataType through GlobalTypeMap (or a DataTypeMap of your own) — built-in types already use the new names.

v2v3
parseBinarydecodeBinary
parseTextdecodeText
parseTextBufferdecodeTextBuffer

The corresponding type aliases were renamed too:

v2v3
ParseTextFunctionDecodeTextFunction
ParseTextBufferFunctionDecodeTextBufferFunction
// v2
const MyType: DataType = {
name: 'my_type',
oid: 90000,
jsType: 'string',
parseBinary(v: Buffer): string {
/* ... */
},
parseText(v: string): string {
/* ... */
},
isType: v => typeof v === 'string',
};

// v3
const MyType: DataType = {
name: 'my_type',
oid: 90000,
jsType: 'string',
decodeBinary(v: Buffer): string {
/* ... */
},
decodeText(v: string): string {
/* ... */
},
isType: v => typeof v === 'string',
};

License change: MIT → BSD-3-Clause

v3 relicenses the project from MIT to BSD-3-Clause. Both are permissive licenses; the practical difference is that BSD-3-Clause requires the copyright notice to be preserved in redistributions. Check your organization's license-compliance policy if it tracks dependency licenses. See License.

Node engine bumped to >=20

v3 requires node >= 20.x. See Installation.

New in v3

None of the following requires changes to existing code — all are new, opt-in capabilities:

For the full list of fixes and improvements, see the project's CHANGELOG.md.