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

react-native-quickjs-turbo

v0.1.4

Published

React Native TurboModule for QuickJS

Downloads

4

Readme

react-native-quickjs-turbo

React Native TurboModule for QuickJS, implemented entirely in C++.

项目结构

├── android/                  # Android构建配置
│   └── build.gradle
├── ios/                      # iOS构建配置
│   └── QuickjsTurboModule.mm  # iOS模块注册文件
├── src/main/cpp/             # C++源代码
│   ├── QuickjsTurboModule.cpp      # 主要实现文件
│   ├── include/
│   │   └── QuickjsTurboModule.h    # 头文件
│   └── third-party/          # 第三方库
│       └── CMakeLists.txt    # QuickJS库配置
├── CMakeLists.txt            # 主CMake配置
├── react-native-quickjs-turbo.podspec  # iOS Podspec文件
├── index.js                  # React Native入口文件
├── package.json              # 项目配置
└── README.md                 # 说明文档

功能特性

  • 全C++实现核心逻辑,跨平台支持
  • 集成QuickJS引擎
  • 支持执行JavaScript代码
  • 支持调用JavaScript函数
  • 支持多例JSContext
  • 使用React Native新架构的TurboModule
  • 支持Android和iOS平台

安装

npm install react-native-quickjs-turbo

使用方法

import QuickjsTurboModule from 'react-native-quickjs-turbo';

// 创建新的JSContext
const contextId = await QuickjsTurboModule.createContext();

// 执行JavaScript代码
const result = await QuickjsTurboModule.evaluateJavascript(contextId, '1 + 2');
console.log(result); // 输出: 3

// 执行JavaScript函数(简化实现)
const funcResult = await QuickjsTurboModule.executeFunction(contextId, 'myFunction', [1, 2, 3]);
console.log(funcResult);

// 销毁JSContext
const destroyed = await QuickjsTurboModule.destroyContext(contextId);
console.log(destroyed); // 输出: true

// 创建多个JSContext
const context1 = await QuickjsTurboModule.createContext();
const context2 = await QuickjsTurboModule.createContext();

// 在不同上下文执行代码
const result1 = await QuickjsTurboModule.evaluateJavascript(context1, 'var x = 10; x + 5');
const result2 = await QuickjsTurboModule.evaluateJavascript(context2, 'var x = 20; x + 5');

console.log(result1); // 输出: 15
console.log(result2); // 输出: 25

构建

Android

cd android
./gradlew assembleDebug

iOS

cd ios
pod install
# 然后使用Xcode打开.xcworkspace文件进行构建

开发

依赖

  • React Native 0.70+
  • CMake 3.13+
  • NDK 25.1+

主要文件说明

  • QuickjsTurboModule.h:定义了TurboModule的接口
  • QuickjsTurboModule.cpp:实现了TurboModule的具体功能
  • CMakeLists.txt:配置了C++库的构建
  • index.js:导出TurboModule供React Native使用

许可证

MIT