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

@lavamoat/react-native-lockdown

v0.1.0

Published

LavaMoat React Native lockdown for running Hardened JavaScript in React Native apps

Downloads

154,011

Readme

LavaMoat React Native lockdown

LavaMoat React Native lockdown sets up Hardened JavaScript in React Native apps.

This is achieved by repairing and hardening the JS engine shared intrinsics. LavaMoat React Native lockdown integrates with Metro through serializer options.

[!WARNING] This has not been tested on Static Hermes yet! Only on default side-by-side versions of Hermes that shipped with React Native.

Install

npm i @lavamoat/react-native-lockdown

or

yarn add @lavamoat/react-native-lockdown

Usage

Babel config

Add the following to your Babel config:

ignore: [/\/ses\.cjs$/, /\/ses-hermes\.cjs$/],

React Native

// babel.config.js
module.exports = {
  ignore: [/\/ses\.cjs$/, /\/ses-hermes\.cjs$/],
  presets: ['module:@react-native/babel-preset'],
}

React Native <= 0.72.x

// babel.config.js
module.exports = {
  ignore: [/\/ses\.cjs$/, /\/ses-hermes\.cjs$/],
  presets: ['module:metro-react-native-babel-preset'],
}

[!NOTE] React Native <= 0.76.x (old minor series) are unsupported

Expo

// babel.config.js
module.exports = function (api) {
  api.cache(true)
  return {
    ignore: [/\/ses\.cjs$/, /\/ses-hermes\.cjs$/],
    presets: ['babel-preset-expo'],
  }
}

[!WARNING] Ensure your Babel config ignore Array<MatchPattern> (MatchPattern) RegExp is correct for both SES shims to avoid Babel transforming SES and ignoring more than necessary.

Metro config

This section describes how to use lockdownSerializer to configure Metro.

Hermes

New config
// metro.config.js
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
const { lockdownSerializer } = require('@lavamoat/react-native-lockdown')

const config = {
  serializer: lockdownSerializer({ hermesRuntime: true }),
}

module.exports = mergeConfig(getDefaultConfig(__dirname), config)
Existing config

If you already used a serializer configuration, you can pass it as second argument. lockdownSerializer will provide the @react-native/js-polyfills by default, but if you specified your own getPolyfills function, Metro is expecting you to provide the polyfills and lockdownSerializer follows that behavior too.

Some modules depend on language features that may not be present in the underlying platform. Shims (other programs that alter JavaScript) may be added, but are obliged to maintain the object capability safety invariants provided by Lockdown and must be carefully reviewed. We call these "vetted shims".

// metro.config.js
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
const { lockdownSerializer } = require('@lavamoat/react-native')

const config = {
  serializer: lockdownSerializer(
    { hermesRuntime: true },
    {
      // your previous serializer config if any, for example:
      getPolyfills: () => {
        return [
          ...require('@react-native/js-polyfills')(),
          require.resolve('path-to-shim'), // e.g. 'reflect-metadata'
        ]
      },
    }
  ),
}

module.exports = mergeConfig(getDefaultConfig(__dirname), config)

[!NOTE] @react-native/js-polyfills is a peer dependency, likely stemming from your React Native version (example):

[email protected]
├─┬ @react-native/[email protected] (devDependencies)
│ └── @react-native/[email protected]
└─┬ [email protected] (dependencies)
  └── @react-native/[email protected] deduped

JavaScriptCore (JSC)

// metro.config.js
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
const { lockdownSerializer } = require('@lavamoat/react-native')

const config = {
  serializer: lockdownSerializer({ hermesRuntime: false }),
}

module.exports = mergeConfig(getDefaultConfig(__dirname), config)

[!NOTE] JSC is moving to a Community Package available starting with React Native 0.79.

V8

Untested on react-native-v8, an opt-in V8 runtime for Android only.

License

Copyright (c) 2024 Consensys Software Inc. Licensed MIT