Json_polyfill - A polyfill for the OTP json module (EEP68)

json_polyfill

This lib is just a copy of the json module proposed in EEP 68 and introduced in OTP 27 by Michał Muskała.

Its intent is to act as a polyfill for apps that cannot currently be updated to OTP 27 or higher.

The module and function names are exactly the same. Then, when your app supports OTP >= 27, just optionally remove this lib from the dependencies.

[!NOTE]

There is no problem keeping this lib on OTP >= 27 when using rebar. The beam file is dropped on compilation time.

Requirements

OTP >= 24.

Installation

Erlang

% rebar.config
{deps, [{json_polyfill, "~> 0.2"}]}.

Elixir

# mix.exs
def deps do
  [{:json_polyfill, "~> 0.2"}]
end

Functions

  • encode
  • decode
  • format

CI

matrix:
  otp-version: [24, 25, 26, 27]
  os: [ubuntu-latest, windows-latest]

Credits

All credits to Michał Muskała and the OTP Team.


7 Likes