{"id":38965150,"url":"https://github.com/apoxy-dev/js-runtime","last_synced_at":"2026-01-17T16:29:06.737Z","repository":{"id":244854896,"uuid":"816432414","full_name":"apoxy-dev/js-runtime","owner":"apoxy-dev","description":"A fork of Extism JS PDK which is a fork of Javy","archived":false,"fork":false,"pushed_at":"2024-06-26T19:00:14.000Z","size":3216,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-26T23:28:50.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apoxy-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T18:33:30.000Z","updated_at":"2024-06-26T19:00:17.000Z","dependencies_parsed_at":"2024-06-17T22:46:53.396Z","dependency_job_id":"ca135125-5da7-4c88-88e8-8e5b4a165ab5","html_url":"https://github.com/apoxy-dev/js-runtime","commit_stats":null,"previous_names":["apoxy-dev/js-runtime"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apoxy-dev/js-runtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoxy-dev%2Fjs-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoxy-dev%2Fjs-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoxy-dev%2Fjs-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoxy-dev%2Fjs-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apoxy-dev","download_url":"https://codeload.github.com/apoxy-dev/js-runtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoxy-dev%2Fjs-runtime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T16:29:06.077Z","updated_at":"2026-01-17T16:29:06.718Z","avatar_url":"https://github.com/apoxy-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apoxy JavaScript Runtime\n![GitHub License](https://img.shields.io/github/license/extism/extism)\n\n## Overview\n\nThis is a JavaScript runtime for the Apoxy Edge Functions. It allows you to write serverless functions in JavaScript that are executed for each in-flight request or as terminating HTTP handler a la Cloudflare Workers.\n\nThis runtime is built using these libraries:\n* [quickjs-wasm-rs](https://github.com/bytecodealliance/javy/tree/main/crates/quickjs-wasm-rs) - A Rust wrapper around QuickJS that compiles to WebAssembly (aka [Javy](https://github.com/bytecodealliance/javy) from Shopify).\n* [wizer](https://github.com/bytecodealliance/wizer) to run user-supplied Javascript code in a WebAssembly sandbox.\n* [Extism Rust PDK](https://github.com/extism/rust-pdk) - A Rust library for writing Extism plugins.\n\nIt interacts with Apoxy Edge Function runtime via the Extism PDK.\n\n## Using with a bundler\n\nYou will want to use a bundler\nif you want to want to or include modules from NPM, or write the plugin in Typescript, for example.\n\nThere are 2 primary constraints to using a bundler:\n\n1. Your compiled output must be CJS format, not ESM.\n2. You must target es2020 or lower.\n\n### Using with esbuild\n\nThe easiest way to set this up would be to use esbuild. The following is a quickstart guide to setting up a project:\n\n```bash\n# Make a new JS project\nnpm init -y\nnpm install esbuild --save-dev\nmkdir src\nmkdir dist\n```\n\nOptionally add a `jsconfig.json` or `tsconfig.json` to improve intellisense:\n\n```jsonc\n{\n  \"compilerOptions\": {\n    \"lib\": [], // this ensures unsupported globals aren't suggested\n    \"types\": [\"@extism/js-pdk\"], // while this makes the IDE aware of the ones that are\n    \"noEmit\": true // this is only relevant for tsconfig.json\n  },\n  \"include\": [\"src/**/*\"]\n}\n```\n\nAdd `esbuild.js`:\n\n```js\nconst esbuild = require('esbuild');\n// include this if you need some node support:\n// npm i @esbuild-plugins/node-modules-polyfill --save-dev\n// const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill')\n\nesbuild\n    .build({\n        // supports other types like js or ts\n        entryPoints: ['src/index.js'],\n        outdir: 'dist',\n        bundle: true,\n        sourcemap: true,\n        //plugins: [NodeModulesPolyfillPlugin()], // include this if you need some node support\n        minify: false, // might want to use true for production build\n        format: 'cjs', // needs to be CJS for now\n        target: ['es2020'] // don't go over es2020 because quickjs doesn't support it\n    })\n```\n\nAdd a `build` script to your `package.json`:\n\n```json\n{\n  \"name\": \"your-plugin\",\n  // ...\n  \"scripts\": {\n    // ...\n    \"build\": \"node esbuild.js \u0026\u0026 apoxy-js dist/index.js -o dist/plugin.wasm\"\n  },\n  // ...\n}\n```\n\n## Compiling the compiler from source\n\n### Prerequisites\nBefore compiling the compiler, you need to install prerequisites.\n\n1. Install Rust using [rustup](https://rustup.rs)\n2. Install the WASI target platform via `rustup target add --toolchain stable wasm32-wasi`\n3. Install the wasi sdk using the makefile command: `make download-wasi-sdk`\n4. Install [CMake](https://cmake.org/install/) (on macOS with homebrew, `brew install cmake`)\n6. Install [Binaryen](https://github.com/WebAssembly/binaryen/) and add it's install location to your PATH (only wasm-opt is required for build process)\n5. Install [7zip](https://www.7-zip.org/)(only for Windows)\n\n\n### Compiling from source\n\nRun make to compile the core crate (the engine) and the cli:\n\n```\nmake\n```\n\nTo test the built compiler (ensure you have Extism installed):\n```bash\n./target/release/apoxy-js bundle.js -o out.wasm\n# =\u003e \"{\\\"count\\\":4}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoxy-dev%2Fjs-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapoxy-dev%2Fjs-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoxy-dev%2Fjs-runtime/lists"}