jsoo-is-sorted-esy

0.0.4 • Public • Published

jsoo-is-sorted

js_of_ocaml bindings for is-sorted.

Just for personal learning and educational purposes. In real life, just use List.sort compare :)

Building vs bundling

For js_of_ocaml case, we use one tool for building and another for bundling:

  • esy is used to gather the OCaml / ReasonML sources and all build tooling (OCaml compiler, Dune, etc).
  • yarn (or npm) is used to gather the JavaScript dependencies from the bindings and also the bundling of resulting JS files.

Installation

As mentioned above, this is not intended to be used. But if it was to be added to an existing project, it would need both esy.json and package.json.

  1. Run yarn add jsoo-is-sorted.
  2. Run esy add jsoo-is-sorted-esy.
  3. Add the library to your dune file:
(executable
  (name App)
  (libraries jsoo-is-sorted)
)

Using it

let foo = IsSorted.isSorted [|20; 3; 124|]

Or with Reason syntax:

let foo = IsSorted.isSorted([|20, 3, 124|]);

Publishing

Due to esy not being able to read esy.json files from published npm packages (this is to prevent downloading and unpacking all tarballs to do version resolution), the bindings are distributed in two packages.

To publish:

  • Make sure both esy.json and package.json have the same version
  • Run npm publish normally
  • Delete package.json
  • Rename esy.json to package.json
  • Run npm publish again to publish jsoo-is-sorted-esy

Readme

Keywords

none

Package Sidebar

Install

npm i jsoo-is-sorted-esy

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

3.63 kB

Total Files

8

Last publish

Collaborators

  • jchavarri