Registry / dflua
library1.0.2jsnpmunverified

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.

npm install dflua
INSTALL
IMPORT
SIG · DFLUA
D
dflua
javascriptv1.0.2
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 'dflua'
const dflua = require('dflua'); dflua.transpile()
ESM-only; CommonJS require may fail depending on Node version.
compileFile
import { compileFile } from 'dflua'
import dflua from 'dflua'; dflua.compileFile()
Named export; no default export provided.
DfluaError
import { DfluaError } from 'dflua'
import { DfluaError } from 'dflua/errors'
Exported at package root, not subpath.

Transpile a simple Lua function into DiamondFire codeblocks.

import { transpile } from 'dflua'; const luaCode = ` function greet(name) print('Hello, ' .. name) end greet('World') `; try { const diamondFireCode = transpile(luaCode, { target: 'codeblocks' }); console.log(diamondFireCode); } catch (err) { console.error('Transpilation failed:', err.message); }
df --version
Debug
Known issues
breakingOutput format changed from JSON to string in v1.0.0
fix
Update code that expects JSON output to parse the string or handle string format.
affects: >=1.0.0
deprecatedOption 'target' is deprecated; use 'output' instead.
fix
Replace `target: 'codeblocks'` with `output: 'codeblocks'`.
affects: >=1.0.2
gotchaOnly supports a subset of Lua 5.1; tables and metatables are not implemented.
fix
Avoid using advanced Lua features until they are supported.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'dflua'
Package not installed or not in node_modules.
fix
Run `npm install dflua` to install the package.
TypeError: dflua.transpile is not a function
Import style mismatch: using default import when only named exports exist.
fix
Use `import { transpile } from 'dflua'` instead of `import dflua from 'dflua'`.
SyntaxError: Unexpected token 'export'
Running ESM code in a CommonJS environment (e.g., older Node without 'type':'module').
fix
Add `"type": "module"` to package.json or use `.mjs` extension.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

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