A JavaScript to PICO-8 Lua transpiler. Write your PICO-8 games in JavaScript!
Visit jspicl.github.io for docs, guides, API and more!
This monorepo contains two packages:
| Package | Description |
|---|---|
| @jspicl/core | The transpiler library - converts JavaScript to PICO-8 Lua |
| @jspicl/cli | Command-line tool for building PICO-8 cartridges |
For most users, the CLI is the easiest way to get started:
npm install -D @jspicl/clijspicl src/game.js output.p8 --config jspicl.config.ts --watchSee the CLI documentation for config file setup and options.
If you want to integrate jspicl into your own build pipeline:
npm install @jspicl/coreimport {jspicl} from "@jspicl/core";
const result = jspicl(`
function _init() {
x = 64;
y = 64;
}
function _draw() {
cls();
circfill(x, y, 4, 8);
}
`);
console.log(result.code); // Lua code
console.log(result.polyfills); // Required polyfill implementationsSee the Core documentation for the full API.
# Install dependencies
yarn install
# Build all packages
yarn build
# Run tests
yarn test
# Format code
yarn format- Node.js 22+
MIT
