Registry / devops / brainforge

brainforge

JSON →
library1.1.4jsnpmunverified

BrainForge 1.1.4 is a JavaScript/TypeScript transpiler that converts code to an enhanced Brainfuck variant with advanced features like garbage collection, GUI/CLI support, and debugging. It maintains standard Brainfuck compatibility while adding optimizations. Ships TypeScript types. Released under MIT. Differentiator: extends the esoteric language for practical applications beyond simple code golf.

npm install brainforge
INSTALL
IMPORT
SIG · BRAINFORGE
B
brainforge
devopsjavascriptv1.1.4
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.

transpile
import { transpile } from 'brainforge'
Main function for transpiling JS/TS to Brainfuck
compile
import { compile } from 'brainforge'
Compiles source string to Brainfuck code
run
import { run } from 'brainforge'
const brainforge = require('brainforge'); brainforge.run()
ESM-only; require not supported

Shows how to transpile JavaScript to enhanced Brainfuck using the transpile function with optimization enabled.

import { transpile } from 'brainforge'; const jsCode = ` let a = 10; let b = 20; console.log(a + b); `; try { const bfCode = transpile(jsCode, { optimize: true }); console.log(bfCode); } catch (err) { console.error('Transpilation failed:', err); }
Debug
Known issues
breakingRemoved support for Node.js <16
fix
Upgrade Node.js to version 16 or higher
affects: >=1.0.0
breakingChanged API: transpile now returns a Promise in v1.1.0+
fix
Use await or .then() when calling transpile()
affects: >=1.1.0
deprecatedThe 'compile' function is deprecated; use 'transpile' instead
fix
Replace compile() with transpile()
affects: >=1.1.0
gotchaTypeScript types are shipped but may be incomplete for advanced options
fix
Use type assertions or augment types if needed
affects: *
gotchaGenerated Brainfuck code may exceed memory limits for large inputs
fix
Set maxCellValue option to limit memory usage
affects: *
gotchaESM-only package; CommonJS require throws error
fix
Use import syntax or switch to dynamic import()
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'brainforge' or its corresponding type declarations.
Missing TypeScript type definitions or incorrect installation
fix
Run 'npm install --save-dev @types/brainforge' if available, or ensure brainforge is installed as a dependency
SyntaxError: Unexpected token 'export'
Using CommonJS require() on an ESM-only package
fix
Change to import syntax: import { transpile } from 'brainforge'
TypeError: transpile is not a function
Incorrect import of default vs named export
fix
Use named import: import { transpile } from 'brainforge'
Error: Node.js version must be >=16.0.0
Running on an older Node.js version
fix
Upgrade Node.js to version 16 or higher
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
brainforge — npm install brainforge · libregistry