Registry / web-framework / glayzzle

glayzzle

JSON →
library0.3.0jsnpmunverified

Glayzzle is a PHP-to-JavaScript transpiler and CLI that allows running PHP scripts using Node.js or in the browser. As of version 0.3.0 (released circa 2016), it is a proof-of-concept with limited functionality: basic PHP syntax transpilation, file execution via CLI, and a simple server mode using Node.js cluster. It does not support many PHP features like PDO, dynamic variable names, or full function libraries. The project appears to be pre-alpha and is not suitable for production use. Differentiators: transpiles PHP to JS using generators/promises for async I/O, targets Node.js ecosystem.

npm install glayzzle
INSTALL
IMPORT
SIG · GLAYZZLE
G
glayzzle
web-frameworkjavascriptv0.3.0
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.

glayzzle
const glayzzle = require('glayzzle')
import glayzzle from 'glayzzle'
Package is CommonJS only; no ES module or TypeScript types available. Use require().
cli
npx glz -r 'echo "hello";'
glz -r "echo 'hello';"
CLI binary 'glz' is the primary interface. Use -r for inline code, -f for files.
Glayzzle API
const Glayzzle = require('glayzzle').Glayzzle; const g = new Glayzzle()
const g = new Glayzzle()
Constructor is exported as property of module, not default export. Check version 0.3.0 exports.

Shows how to use Glayzzle programmatically to transpile and execute a simple PHP echo statement in Node.js.

const glayzzle = require('glayzzle'); const glz = new glayzzle.Glayzzle(); // Transpile a simple PHP snippet glz.eval('echo "Hello from PHP!";').then(output => { console.log(output); }).catch(err => { console.error(err); });
glayzzle --version
Debug
Known issues
gotchaPackage is proof-of-concept; most PHP features not supported (PDO, mysql, dynamic variables).
fix
Do not use for production. Check feature list before using.
affects: <=0.3.0
deprecatedLast version 0.3.0 from 2016; no updates or maintenance.
fix
Look for alternatives like phpto.js or use php-wasm in browser.
affects: *
breakingCLI may not work on Windows due to unix-style paths and dependencies.
fix
Use WSL or Docker on Windows.
affects: *
gotchaAsynchronous transpilation uses promises; synchronous PHP code blocks Node event loop.
fix
Use promises and avoid blocking I/O patterns.
affects: *
breakingNo PHP library support; built-in functions like array_merge are not implemented.
fix
Rewrite PHP logic in JavaScript or use polyfills.
affects: *
Errors
Common errors & fixes
Cannot find module 'php-parser'
Missing dependency php-parser not installed automatically.
fix
npm install php-parser
TypeError: glayzzle.Glayzzle is not a constructor
Incorrect import pattern; used default import instead of named import.
fix
const { Glayzzle } = require('glayzzle')
Error: PHP syntax error: unexpected token
Glayzzle does not support full PHP syntax, e.g., short array syntax [], closures, etc.
fix
Simplify PHP code or use alternative transpiler.
bash: glz: command not found
glz is not in PATH or not installed globally.
fix
Run npx glz instead of glz, or install globally with npm install -g glayzzle
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
php-parserrequiredCore dependency for PHP syntax parsing
Agent activity
2 hits · last 30 days
node
2
Resources
glayzzle — npm install glayzzle · libregistry