A Node.js utility that converts Processing (Java-based) sketches into p5.js JavaScript code. Current stable version is 1.0.1. The tool parses Processing code using java-parser, applies transformations (e.g., converting size() to createCanvas()), and formats output with js-beautify. Unlike manual conversion or similar tools, it provides automated conversion with formatting. Release cadence is low; updates are occasional.
npm install processing-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use the convertToP5 function to transpile a simple Processing sketch.
Ensure Processing code is syntactically correct Java-like code without unsupported constructs (e.g., classes, arrays).
Check the p5.js reference and manually adjust unsupported calls.
Manually translate class usage to p5.js equivalents (objects, functions).
Simplify code to basic functions and variables; avoid OOP constructs.
Use `import { convertToP5 } from 'processing-transpiler'`.Run `npm install processing-transpiler` and ensure the import path is correct.