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

@nasi/ppx-reanimated-worklet

v0.1.3

Published

[Esy dependency] PPX rewriters for React Native Reanimated

Readme

ppx-reanimated-worklet

PPX Rewriters for React Native Reanimated

This rewriter adds the following extensions:

  1. %wklt
  2. %worklet
  3. %runOnJS
  4. %runOnUI
  5. %apply

Installation

  1. Install ppx-install
npm install --save-dev ppx-install
  1. Add the following to package.json
{
  "ppx": ["@nasi/ppx-reanimated-worklet"]
}
  1. Add the following to bsconfig.json
{
  "ppx-flags": ["ppx-install"]
}
  1. Prebuild the PPX rewriter
npx ppx-install --build

%wklt

This extension works on ReasonML and OCaml, and rewrites the following:

let%wklt f a b = a + b

into

function f(a, b) {
  "worklet";
  return a + b;
}

here, f has type:

type f : (int -> int -> int) Reanimated.worklet2

NOTE The equivalent syntax in ReScript is below. However, it is untested.

%%wklt(let f = (a, b) => a + b)

%worklet

This allows any function expression to be written as a React Native Reanimated 2 worklet, as such:

@react.component
let make = () => {
  let f = %worklet(() => viewStyle());
  // useAnimatedStyle expects the function inside to be a worklet.
  // Although it can take any function expression that doesn't have
  // the "worklet" directive, if you're passing a function by value,
  // then that function must be defined with the "worklet" directive
  // for it to be visible on the UI JS runtime.
  let style = useAnimatedStyle(f);
  <Reanimated.View style />
}

%runOnJS

A wrapper around React Native Reanimated 2's runOnJS method. Use as such:

let log = (a) => {
  // some logic that doesn't exist in UI thread
  Js.log(foo(a));
}

let f = %worklet((a) => {
  %runOnJS(log(a))
})

The above function translates roughly to:

function log(a) {
  console.log(foo(a));
}

// Note that Curry._x utility functions won't be
// generated here. However, if lists and other ML
// data structures are used, they'll show up here,
// and since they're not serialised into the UI
// thread, the app will crash.

function f(a) {
  "worklet";
  let g = runOnJS(log);
  g(a);
}

%runOnUI

Similar to %runOnJS, wraps the runOnUI method in React Native Reanimated 2.

%apply

This extension is used to wrap a function call to a worklet. A worklet can be called in either a host function or a worklet.

let worklet = %worklet((a) => a + 1)

let f = (a) => %apply(worklet(a))

let worklet2 = %worklet((a) => %apply(worklet(a)))

This creates the below translation:

function worklet(a) {
  "worklet";
  return a + 1;
}

function f(a) {
  return worklet(a);
}

// Note that Curry._x utility functions won't be
// generated here. However, if lists and other ML
// data structures are used, they'll show up here,
// and since they're not serialised into the UI
// thread, the app will crash.

function worklet2(a) {
  "worklet";
  return worklet(a);
}