Registry / devops / processing-to-p5js

processing-to-p5js

JSON →
library0.1.3jsnpmunverified

A transpiler that converts Processing (Java) source code to p5.js (JavaScript). Current stable version 0.1.3 transforms syntax like void functions, size(), and Processing APIs into p5.js equivalents. Released as an early-stage tool with TypeScript type declarations. Suitable for migrating Processing sketches to the browser. Does not cover all Processing features; manual adjustments may be needed.

npm install processing-to-p5js
INSTALL
IMPORT
SIG · PROCESSING-TO-P5JS
P
processing-to-p5js
devopsjavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transformCode
import { transformCode } from 'processing-to-p5js'
const transformCode = require('processing-to-p5js').transformCode
Package is ESM; Named import from package.
transformProcessing
import { transformProcessing } from 'processing-to-p5js'
import processingToP5js from 'processing-to-p5js'
Default export not available; use named import.
isStaticModeSketch
import { isStaticModeSketch } from 'processing-to-p5js'
Named export; TypeScript types included.

Transpile a simple Processing sketch with setup() and draw() to p5.js code.

import { transformProcessing } from 'processing-to-p5js'; const processingCode = ` void setup() { size(400, 400); background(220); } void draw() { ellipse(mouseX, mouseY, 20, 20); } `; const p5jsCode = transformProcessing(processingCode); console.log(p5jsCode);
processing-to-p5js --version
Debug
Known issues
gotchatransformProcessing replaces Processing built-in functions like size(), background(), ellipse() but does not handle all Processing APIs.
fix
Review output for untranslated functions and manually implement p5.js equivalents.
affects: >=0.1.0
gotchaThe package does not transform Java language features beyond basic syntax (e.g., classes, generics, libraries).
fix
Rewrite complex Java patterns manually.
affects: >=0.1.0
deprecatedtransformCode() function is experimental and may change in future versions.
fix
Prefer transformProcessing() for full transformation.
affects: 0.1.0
Errors
Common errors & fixes
TypeError: (0 , processing_to_p5js.transformProcessing) is not a function
Incorrect import due to mistaken belief that package has default export.
fix
Use named import: import { transformProcessing } from 'processing-to-p5js'
Cannot find module 'processing-to-p5js' or its corresponding type declarations.
Missing installation or TypeScript not configured for ESM.
fix
Run 'npm install processing-to-p5js' and ensure 'moduleResolution' is 'node16' or 'bundler' in tsconfig.json.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
processing-to-p5js — npm install processing-to-p5js · libregistry