{"id":25168,"library":"dflua","title":"dflua","description":"A Lua-to-DiamondFire transpiler, version 1.0.2. Converts Lua code into DiamondFire code blocks for use within the Minecraft server plugin DiamondFire. No release cadence documented. Key differentiator: enables DiamondFire developers to write code in a higher-level language (Lua) instead of graphical blocks. Minimal documentation and low adoption.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","lua","transpiler","compiler","diamondfire"],"install":[{"cmd":"npm install dflua","lang":"bash","label":"npm"},{"cmd":"yarn add dflua","lang":"bash","label":"yarn"},{"cmd":"pnpm add dflua","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require may fail depending on Node version.","wrong":"const dflua = require('dflua'); dflua.transpile()","symbol":"transpile","correct":"import { transpile } from 'dflua'"},{"note":"Named export; no default export provided.","wrong":"import dflua from 'dflua'; dflua.compileFile()","symbol":"compileFile","correct":"import { compileFile } from 'dflua'"},{"note":"Exported at package root, not subpath.","wrong":"import { DfluaError } from 'dflua/errors'","symbol":"DfluaError","correct":"import { DfluaError } from 'dflua'"}],"quickstart":{"code":"import { transpile } from 'dflua';\n\nconst luaCode = `\nfunction greet(name)\n  print('Hello, ' .. name)\nend\n\ngreet('World')\n`;\n\ntry {\n  const diamondFireCode = transpile(luaCode, { target: 'codeblocks' });\n  console.log(diamondFireCode);\n} catch (err) {\n  console.error('Transpilation failed:', err.message);\n}","lang":"typescript","description":"Transpile a simple Lua function into DiamondFire codeblocks."},"warnings":[{"fix":"Update code that expects JSON output to parse the string or handle string format.","message":"Output format changed from JSON to string in v1.0.0","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Replace `target: 'codeblocks'` with `output: 'codeblocks'`.","message":"Option 'target' is deprecated; use 'output' instead.","severity":"deprecated","affected_versions":">=1.0.2"},{"fix":"Avoid using advanced Lua features until they are supported.","message":"Only supports a subset of Lua 5.1; tables and metatables are not implemented.","severity":"gotcha","affected_versions":">=0.1.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 dflua` to install the package.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'dflua'"},{"fix":"Use `import { transpile } from 'dflua'` instead of `import dflua from 'dflua'`.","cause":"Import style mismatch: using default import when only named exports exist.","error":"TypeError: dflua.transpile is not a function"},{"fix":"Add `\"type\": \"module\"` to package.json or use `.mjs` extension.","cause":"Running ESM code in a CommonJS environment (e.g., older Node without 'type':'module').","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}