Skip to content

jspicl/jspicl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jspicl

A JavaScript to PICO-8 Lua transpiler. Write your PICO-8 games in JavaScript!
Visit jspicl.github.io for docs, guides, API and more!

Packages

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

Quick Start

For most users, the CLI is the easiest way to get started:

npm install -D @jspicl/cli
jspicl src/game.js output.p8 --config jspicl.config.ts --watch

See the CLI documentation for config file setup and options.

Using the Core Library

If you want to integrate jspicl into your own build pipeline:

npm install @jspicl/core
import {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 implementations

See the Core documentation for the full API.

Development

# Install dependencies
yarn install

# Build all packages
yarn build

# Run tests
yarn test

# Format code
yarn format

Requirements

  • Node.js 22+

License

MIT

Packages

 
 
 

Contributors