Git Product home page Git Product logo

jsoo-is-sorted's Introduction

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

jsoo-is-sorted's People

Contributors

jchavarri avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.