Registry / devtools / kalang

kalang

JSON →
library0.0.24jsnpmunverified

KaLang is a programming language transpiled to JavaScript, designed to make game development fast and fun. It provides a custom syntax and a command-line transpiler. The current stable version is 0.0.24, released with active development. Key differentiators include a specialized focus on game development and a custom VSCode extension for editor support. It is not yet stable for production use and lacks extensive documentation or community adoption compared to established languages.

npm install kalang
INSTALL
IMPORT
SIG · KALANG
K
kalang
devtoolsjavascriptv0.0.24
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.

kalang
import { kalang } from 'kalang'
const kalang = require('kalang')
The package is ESM-only; CommonJS require is not supported.
transpile
import { transpile } from 'kalang'
const transpile = require('kalang').transpile
Named export for transpiling KaLang code.
run
import { run } from 'kalang'
import { runProgram } from 'kalang'
The correct export is 'run', not 'runProgram'.

Shows how to programmatically run a KaLang file using the run function and also the CLI method.

import { run } from 'kalang'; import { readFileSync } from 'fs'; const code = readFileSync('program.ka', 'utf8'); run(code).then(() => console.log('Done')); // Or use the CLI: // npm i -g kalang // kalang run program.ka
Debug
Known issues
breakingBreaking changes in minor versions: API may change without notice.
fix
Pin to exact version and test updates.
affects: >=0.0.1 <1.0.0
deprecatedThe 'compile' function is deprecated in favor of 'transpile'.
fix
Use 'transpile' instead of 'compile'.
affects: >=0.0.20
gotchaKaLang CLI requires global installation; local install may not expose 'kalang' command.
fix
Use npx kalang or install globally with -g.
affects: >=0.0.1
gotchaThe language is experimental; not suitable for production use.
fix
Evaluate stability before using in production.
affects: >=0.0.1
deprecatedSupport for Node.js <14 has been dropped.
fix
Upgrade Node.js to version 14 or higher.
affects: >=0.0.22
Errors
Common errors & fixes
Error: Cannot find module 'kalang'
Missing local installation or attempting to require CommonJS.
fix
npm install kalang or use import instead of require.
SyntaxError: Unexpected token 'export'
Using CommonJS require on an ESM-only package.
fix
Use import syntax or set type: 'module' in package.json.
kalang: command not found
CLI not globally installed.
fix
npm install -g kalang or npx kalang.
TypeError: kalang.run is not a function
Incorrect import; using default instead of named export.
fix
import { run } from 'kalang' instead of import kalang from 'kalang'.
Upgrade
Version history
0.0.24latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
24
Resources
packagekalang
kalang — npm install kalang · libregistry