{"id":25013,"library":"brainforge","title":"BrainForge","description":"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.","status":"active","version":"1.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/TahaUsmanK/brainforge","tags":["javascript","brainfuck","transpiler","compiler","typescript","programming-language","esoteric"],"install":[{"cmd":"npm install brainforge","lang":"bash","label":"npm"},{"cmd":"yarn add brainforge","lang":"bash","label":"yarn"},{"cmd":"pnpm add brainforge","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Main function for transpiling JS/TS to Brainfuck","symbol":"transpile","correct":"import { transpile } from 'brainforge'"},{"note":"Compiles source string to Brainfuck code","symbol":"compile","correct":"import { compile } from 'brainforge'"},{"note":"ESM-only; require not supported","wrong":"const brainforge = require('brainforge'); brainforge.run()","symbol":"run","correct":"import { run } from 'brainforge'"}],"quickstart":{"code":"import { transpile } from 'brainforge';\n\nconst jsCode = `\n  let a = 10;\n  let b = 20;\n  console.log(a + b);\n`;\n\ntry {\n  const bfCode = transpile(jsCode, { optimize: true });\n  console.log(bfCode);\n} catch (err) {\n  console.error('Transpilation failed:', err);\n}","lang":"typescript","description":"Shows how to transpile JavaScript to enhanced Brainfuck using the transpile function with optimization enabled."},"warnings":[{"fix":"Upgrade Node.js to version 16 or higher","message":"Removed support for Node.js <16","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use await or .then() when calling transpile()","message":"Changed API: transpile now returns a Promise in v1.1.0+","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"Replace compile() with transpile()","message":"The 'compile' function is deprecated; use 'transpile' instead","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Use type assertions or augment types if needed","message":"TypeScript types are shipped but may be incomplete for advanced options","severity":"gotcha","affected_versions":"*"},{"fix":"Set maxCellValue option to limit memory usage","message":"Generated Brainfuck code may exceed memory limits for large inputs","severity":"gotcha","affected_versions":"*"},{"fix":"Use import syntax or switch to dynamic import()","message":"ESM-only package; CommonJS require throws error","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev @types/brainforge' if available, or ensure brainforge is installed as a dependency","cause":"Missing TypeScript type definitions or incorrect installation","error":"Cannot find module 'brainforge' or its corresponding type declarations."},{"fix":"Change to import syntax: import { transpile } from 'brainforge'","cause":"Using CommonJS require() on an ESM-only package","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use named import: import { transpile } from 'brainforge'","cause":"Incorrect import of default vs named export","error":"TypeError: transpile is not a function"},{"fix":"Upgrade Node.js to version 16 or higher","cause":"Running on an older Node.js version","error":"Error: Node.js version must be >=16.0.0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}