open-index/open-npm huggingface dataset:
npm package: @roddynpm/bs-fojson
Description: "fojson" = "faux (yo)json"
Latest version: 0.4.0

"fojson" = "faux (yo)json"

There are [bs-yojson](https://github.com/roddyyaga/bs-yojson) provides direct BuckleScript bindings for
[yojson](https://github.com/ocaml-community/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
npm package: @roddynpm/bs-ppx_deriving_yojson
Description: An npm package of the [ppx_deriving_yojson](https://github.com/ocaml-ppx/ppx_deriving_yojson) plugin.
Latest version: 0.1.0

An npm package of the [ppx_deriving_yojson](https://github.com/ocaml-ppx/ppx_deriving_yojson) plugin.

# Usage
Add `bs-deriving`, `@roddynpm/bs-yojson` and `@roddynpm/bs-ppx_deriving_yojson` as dependencies in `package.json` and
`bs-dependencies` in `bsconfig.json`. Additionally you must add `"pp-flags": "@roddynpm/bs-ppx_deriving_yojson/ppx.exe"`
to `bsconfig.json`.

# Limitations
The actual ppx rewriter is a hack (it is just the executable generated when a dummy project that uses ppx\_deriving\_yojson is built with dune). It was built on 64-bit Linux using OCaml 4.07.0, so if you have a setup that is incompatible with that you will need to create your own executable. This can be done with `dune clean && dune build -- dummy/test.exe && cp _build/default/.ppx/*/ppx.exe .` in the root of the package.

It is possible to use both this and `ppx-deriving` in the same project. To do this you should only include the `"pp-flags": "@roddynpm/bs-ppx_deriving_yojson/ppx.exe"` line in your `bsconfig.json`, and not the usual `"ppx-flags": ...` line for `ppx-deriving`. This is because the `ppx-deriving` executables don't contain the yojson deriver and so break on code that uses it. To allow both sets of derivers to be used together, the ppx executable in this package was built to include the standard `ppx_deriving` plugins.