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

@reversense/dexcalibur-frida-compile

v10.2.6

Published

Compile a Frida script comprised of one or more Node.js modules

Readme

@dexcalibur/dexcalibur-frida-compile

A compiler for Frida scripts comprised of one or more Node.js modules, supporting JavaScript, TypeScript, and Cylang.

Overview

This tool compiles Node.js modules into Frida-compatible scripts using Browserify and tsify. It bundles your code along with dependencies, handles TypeScript compilation, and provides optional features like compression, bytecode compilation, and watch mode for development.

Installation

npm install @dexcalibur/dexcalibur-frida-compile

Requirements

  • Node.js >= 10.12.0

Usage

Command Line

frida-compile [options] <module>

Options

  • -o, --output <file> - Set output file (required)
  • -w, --watch - Watch for changes and recompile automatically
  • -b, --bytecode - Output bytecode (requires frida package)
  • -S, --no-sourcemap - Omit sourcemap
  • -c, --compress - Compress using UglifyJS2
  • -a, --use-absolute-paths - Use absolute source paths
  • -t, --tsconfig <file> - Path to tsconfig file for TypeScript compilation
  • -s, --standalone <name> - Export agent contents under external module name

Examples

Basic compilation:

frida-compile index.js -o agent.js

TypeScript with watch mode:

frida-compile agent.ts -o _agent.js -w

Compressed bytecode output:

frida-compile index.js -o agent.js -c -b

With custom TypeScript config:

frida-compile agent.ts -o _agent.js -t tsconfig.json

Programmatic API

const compiler = require('@dexcalibur/dexcalibur-frida-compile');

Build Once

await compiler.build(inputPath, outputPath, options);

Parameters:

  • inputPath (string) - Path to entry module
  • outputPath (string) - Path for output file
  • options (object) - Compilation options
    • cwd (string) - Base directory
    • sourcemap (boolean) - Include sourcemap (default: true)
    • compress (boolean) - Compress output
    • bytecode (boolean) - Compile to bytecode
    • tsconfig (string) - Path to tsconfig.json
    • standalone (string) - Standalone module name

Example:

const compiler = require('@dexcalibur/dexcalibur-frida-compile');

await compiler.build('./agent.js', './_agent.js', {
  compress: true,
  sourcemap: true
});

Watch Mode

const watcher = compiler.watch(inputPath, outputPath, options);

Returns an EventEmitter with the following events:

  • compile - Emitted on successful compilation

    watcher.on('compile', ({ files, duration }) => {
      console.log(`Compiled ${files.length} files in ${duration}ms`);
    });
  • error - Emitted on compilation error

    watcher.on('error', (error) => {
      console.error('Compilation failed:', error);
    });

Example:

const compiler = require('@dexcalibur/dexcalibur-frida-compile');

const watcher = compiler.watch('./agent.ts', './_agent.js', {
  sourcemap: true
});

watcher.on('compile', ({ files, duration }) => {
  console.log(` Compiled ${files.length} files in ${duration}ms`);
});

watcher.on('error', (error) => {
  console.error(' Compilation failed:', error.message);
});

Features

Supported File Types

  • JavaScript (.js) - Standard ES modules
  • TypeScript (.ts) - Automatically transpiled
  • JSON (.json) - Imported as modules
  • Cylang (.cy) - Requires cylang package

Frida-Compatible Builtins

The following Node.js modules are replaced with Frida-compatible implementations:

  • processfrida-process
  • bufferfrida-buffer
  • fsfrida-fs
  • httpfrida-http
  • netfrida-net
  • any-promisefrida-any-promise
  • bignumbignumber.js

Bytecode Compilation

To compile to bytecode, you need to install the frida package:

npm install frida

Then use the -b or --bytecode flag:

frida-compile agent.js -o agent.js -b

TypeScript Support

TypeScript files are automatically detected and compiled. You can provide a custom tsconfig.json:

frida-compile agent.ts -o _agent.js -t ./tsconfig.json

Compression

Code compression using UglifyJS2 can be enabled with the -c flag:

frida-compile agent.js -o agent.js -c

Development

# Lint code
npm run pretest

Related Projects

  • Frida - Dynamic instrumentation toolkit
  • Browserify - Module bundler
  • tsify - TypeScript plugin for Browserify