npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ppx-install

v0.3.0

Published

Install Esy/OPAM repositories into ReScript

Downloads

4

Readme

ppx-install

Install Esy/OPAM repositories into ReScript

oclif Version Downloads/week License

Usage

Step 0: Add ppx-install into devDependencies

npm install --save-dev ppx-install

Step 1: Add ppx key to package.json.

{
  "ppx": [
    "@opam/ppx_let",
    "@opam/ppx_sexp_conv"
  ]
}

Step 2: Add the following into bsconfig.json.

{
  "ppx-flags": ["ppx-install"]
}

Step 3: Pre-build the PPX rewriters by executing:

npx ppx-install --build

As of 0.3.0 this is no longer optional, since ppx-install now looks at the entire dependency tree and rewrites dependencies which in turn relies on ppx-install.

Step 4: Ignore the generated _ppx directory in .gitignore

Commands

ppx-install supports the following commands:

--build

Generate and build a PPX rewriter executable based on definitions.

npx ppx-install --build

--clean

Removes all traces of the generated project in _ppx directory

npx ppx-install --clean

Declarations

A list of dependencies can be added. These can either be OPAM dependencies or NPM dependencies understandable by Esy.

Similar to how Esy works with OPAM packages, to declare an OPAM package, simply use the @opam scope.

The following is an example of how it's used:

{
  "ppx": [
    ["@opam/ppx_jane", ">=v0.14.0"],  // used to specify a specific version
    "@opam/ppx_sexp_conv",            // unrestricted OPAM package
    "@nasi/ppx-react-native",         // unrestricted NPM package
    ["@nasi/ppx-react-native", "diaozheng999/ppx-react-native"] // git-repositories can also be used as version specifications
  ]
}

If package.json is not used, you can alternatively define a ppx.json file with the following:

  "package-name": [
    "ppx1",
    "ppx2"
  ]

This will automatically creates a project named ppx_package_name with the dependencies installed.

How it works

ppx-install works by generating a Esy project with all the declared dependencies. It then creates a dune file to list out the dependent rewriters and compile an optimised rewriter that changes the code in one pass.

On executing without any flags (such as through bsb -make-world), we first check and hash the dependencies, and look into the _ppx folder for ppx.exe. If this is found, we simply execute this exe with the -as-ppx flag.

If the executable is not found, we will attempt to generate and build the project, and execute the rewriter again.

On Windows, Esy requires administrator prompt to allow symlinks. As such, we automatically prompt and execute the Esy build phase in an Administrator command prompt.

We always compile to a later version of OCaml (Currently targetting 4.11.x). Although this is not ideal, the 4.06.1 syntax is a subset of the later versions and so far it seems to work. Having later versions also allow us to include newer native targets such as Windows and Apple Silicon macs.

So far, we've only been working with Ppxlib rewriters. Older rewriters may or may not work well. I haven't tested them yet.

In attempt to speed up execution, the md5 check is removed. Whenever PPX dependencies are updated, please run ppx-install --build to get the newest ppx.exe.