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

@componentor/quickjs-for-quickjs

v0.31.35

Published

![yo dawg i herd u like quickjs so i put quickjs in ur quickjs so u can eval while u eval](./yodawg.jpg)

Readme

quickjs-for-quickjs

yo dawg i herd u like quickjs so i put quickjs in ur quickjs so u can eval while u eval

This package is a build of quickjs-emscripten that can run inside QuickJS or any other JavaScript runtime without WebAssembly support. The QuickJS C library is compiled to Asm.js, and then bundled together with the quickjs-emscripten JavaScript wrapper into a single standalone file with no external dependencies.

quickjs-for-quickjs has been tested in the following configurations:

  • ✅ NodeJS -> quickjs-for-quickjs
  • ✅ NodeJS -> quickjs-emscripten RELEASE_SYNC -> quickjs-for-quickjs
  • ❌ NodeJS -> quickjs-emscripten RELEASE_SYNC -> quickjs-for-quickjs -> quickjs-for-quickjs (This hits stack overflow in QuickJS. It could work with a larger stack size for the outer QuickJS instance)

Why?

For fun!

This could have practical applications, like if you're a user writing a plugin for a 3rd-party system using quickjs-emscripten for scripting, and you as a plugin author also want your plugin to have its own plugin ecosystem.

Usage

For a more detailed example, see the "example" directory in the repo.

// nodejs-host.mjs
import fs from "node:fs/promises"
import module from "node:module"
import { getQuickJS, setUpContext } from "quickjs-for-quickjs"

// get quickjs source code
const require = module.createRequire(import.meta.url)
const quickjsSource = await fs.readFile(require.resolve("quickjs-for-quickjs"), "utf8")

// create the host QuickJS context
const QuickJS = await getQuickJS()
const context = QuickJS.createContext()

// inject console.log, which is required for quickjs-for-quickjs to work
setUpContext(context)

// allow the host QuickJS to import quickjs-for-quickjs module
context.runtime.setModuleLoader((name) => {
  if (name === "quickjs-for-quickjs") {
    return quickjsSource
  }
  throw new Error(`Module not found: ${name}`)
})

const quickjsHost = `
// import and create inner QuickJS guest context
import { getQuickJS } from "quickjs-for-quickjs"
const context = await getQuickJS().then(mod => mod.createContext())

// eval some code in the inner context
const innerResult = context.evalCode('1 + 2', "quickjs-guest.mjs").unwrap()

// export the result
export const result = innerResult.consume(context.dump)
`

// eval the quickjs host
const handle = context.evalCode(quickjsHost, "quickjs-host.mjs").unwrap()

// get the result
context.runtime.executePendingJob()
const result = context.unwrapResult(context.getPromiseState(handle))

console.log(result.consume(context.dump))