Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notepack.io

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notepack.io - npm Package Versions

2

3.0.1

Diff

Changelog

Source

3.0.1 (2022-05-22)

The browser bundle was not updated in the previous release.

darrachequesne
published 3.0.0 •

Changelog

Source

3.0.0 (2022-05-22)

Features

  • add support for BigInt.prototype.toJSON (#28) (9ec1fcd)

This change allows to properly encode BigInt objects:

// always as string
BigInt.prototype.toJSON = function () {
  return String(this);
};
// or either as string or number, depending on the value
BigInt.prototype.toJSON = function () {
  var isSafeNumber = Number.MIN_SAFE_INTEGER <= this && this <= Number.MAX_SAFE_INTEGER;
  return isSafeNumber ? Number(this) : String(this);
};
  • encode ArrayBuffer objects as bin (8209327)
import { encode } from "notepack.io";

encode(Uint8Array.of(1, 2, 3, 4));

// before: <Buffer c7 04 00 01 02 03 04>
// after: <Buffer c4 04 01 02 03 04>

ArrayBuffer objects encoded with previous versions of the library will still be decoded, but as Buffer instead of Uint8Array.

Reference: https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family

  • encode Date objects following the official timestamp extension (9fb6275)
import { encode } from "notepack.io";

encode(new Date("2000-06-13T00:00:00.000Z"));

// before: <Buffer d7 00 00 00 00 df b7 62 9c 00>
// after: <Buffer d6 ff 39 45 79 80>

Date objects encoded with previous versions of the library will still be properly decoded.

Reference: https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type

  • match JSON.stringify() behavior (21c6592)

The library will now match the behavior of the JSON.stringify() method:

  • undefined is now encoded as nil (0xc0)
  • undefined values in objects are now ignored
import { encode, decode } from "notepack.io";

const value = {
  a: undefined,
  b: null,
  c: [undefined, null]
};

decode(encode(value));

// before:
// {
//   a: undefined,
//   b: null,
//   c: [undefined, null]
// }
// after:
// {
//   b: null,
//   c: [null, null]
// }
darrachequesne
published 2.3.0 •

Changelog

Source

2.3.0 (2020-03-15)

Performance Improvements

  • decode: add a cache for buffer-to-string conversions (3c0e5a6)
  • encode: add a cache for string-to-buffer conversions (60e8b0b)
darrachequesne
published 2.2.0 •

Changelog

Source

2.2.0 (2018-12-18)

darrachequesne
published 2.1.3 •

Changelog

Source

2.1.3 (2018-05-14)

Bug Fixes

darrachequesne
published 2.1.2 •

Changelog

Source

2.1.2 (2017-08-23)

Bug Fixes

  • encode: remove the unsafe integer check (#15) (bb8140c)
darrachequesne
published 2.1.1 •

Changelog

Source

2.1.1 (2017-08-08)

Bug Fixes

  • browser: fix decoding for strings with surrogate pairs (#13) (a89e566)
  • browser: preserve the offset and length when creating a DataView (#11) (bd91aa7)
darrachequesne
published 2.1.0 •

Changelog

Source

2.1.0 (2017-07-31)

Features

  • add support for toJSON method (#8) (9345f9f), closes #7
darrachequesne
published 2.0.1 •

Changelog

Source

2.0.1 (2017-06-06)

Bug Fixes

  • encode: fix encoding for non-finite numbers (#4) (f0ed0f3)
darrachequesne
published 2.0.0 •

Changelog

Source

2.0.0 (2017-05-19)

Features

  • Add support for ArrayBuffer (#2) (9eec8dc)
  • browser: switch from Buffer polyfill to ArrayBuffer (#1) (8d7ce87)
2
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc