Package Exports
- @jspicl/core
- @jspicl/core/pic8-api.d.ts
- @jspicl/core/types
Readme
@jspicl/core
The core transpiler library for jspicl. Converts JavaScript to PICO-8 Lua.
Installation
npm install @jspicl/coreUsage
import {jspicl} from "@jspicl/core";
const javascript = `
function _init() {
x = 64;
y = 64;
}
function _update() {
if (btn(0)) x -= 1;
if (btn(1)) x += 1;
if (btn(2)) y -= 1;
if (btn(3)) y += 1;
}
function _draw() {
cls();
circfill(x, y, 4, 8);
}
`;
const result = jspicl(javascript);
console.log(result.code);
// Output: Lua code ready for PICO-8
console.log(result.polyfills);
// Output: Any required polyfill implementationsVisit jspicl.github.io for detailed documentation.