@roddynpm/bs-fojson

0.4.0 • Public • Published

"fojson" = "faux (yo)json"

There are bs-yojson provides direct BuckleScript bindings for yojson. However, they produce a large amount of JavaScript (because yojson implements JSON parsing/printing itself). This package rewrites parts of Yojson to reduce the size of the JavaScript produced by using JavaScript JSON parsing/printing. It should also be faster because of this. There are some changes to the API as specified in yojson.mli (for instance a lot of undocumented functions are removed) but it should stay the same for the purposes of ppx_yojson_conv and ppx_deriving_yojson.

Changes that have been made:

  • Removed undocumented functions
  • Changed yojson-to-string implementations to go via Js.Json
  • Changed string-to-yojson implementations to go via Js.Json and a hack to account for the JSON representation of ints and floats being the same
  • Changed default mode to standard JSON rather than OCaml extensions

Package Sidebar

Install

npm i @roddynpm/bs-fojson

Weekly Downloads

7

Version

0.4.0

License

BSD

Unpacked Size

586 kB

Total Files

379

Last publish

Collaborators

  • roddynpm