Registry / web-framework / bembajs-core

bembajs-core

JSON →
library1.4.27jsnpmunverified

The core compiler and runtime for the Bemba programming language, enabling React-based web development with Bemba syntax (a Zambian language). Current stable version is 1.4.27, with an active release cadence focused on React integration and tooling. Key differentiators: it is the first programming language based on an African language (Bemba), compiled to JavaScript with full React compatibility. It supports conditionals, loops, async/await, and state management with Bemba keywords. Notably, it requires React 18+ and ReactDOM as peer dependencies. Ships TypeScript definitions and supports ESM/CJS.

npm install bembajs-core
INSTALL
IMPORT
SIG · BEMBAJS-CORE
B
bembajs-core
web-frameworkjavascriptv1.4.27
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.

bembaJS
import { bembajs } from 'bembajs-core'
const bembajs = require('bembajs-core')
ESM-only since v1.4.0; CJS not supported in recent versions.
compileBemba
import { compileBemba } from 'bembajs-core'
import compileBemba from 'bembajs-core'
Named export, not default.
BembaRuntime
import { BembaRuntime } from 'bembajs-core'
TypeScript type used for runtime config.

Compiles Bemba language code into a React component with state management.

import { compileBemba } from 'bembajs-core'; const bembaCode = ` ukusunga (@mut) count = 0; ukulomba @mut count; ukusapoti() { @mut count += 1; } `; const compiled = compileBemba(bembaCode); console.log(compiled); // Output: React component with hooks
bembajs --version
Debug
Known issues
deprecatedukusungaKabili is deprecated and will be removed in v2.0.
fix
Replace with ukusunga and useEffect manually.
affects: >=1.1.0 <2.0.0
breakingESM-only since v1.4.0 - CJS require() will fail.
fix
Use import syntax or migrate to ESM.
affects: >=1.4.0
gotchaPeer dependencies react and react-dom must be installed separately.
fix
Run: npm install react react-dom
affects: >=1.0.0
breakingState management keywords changed in v1.2.0 (ukusunga replaces ukusinga).
fix
Update code to use ukusunga instead of ukusinga.
affects: >=1.2.0
gotcha.bemba files require a Babel plugin or custom build step to compile.
fix
Use the BembaJS Vite plugin or compile via CLI before bundling.
affects: >=1.0.0
Errors
Common errors & fixes
SyntaxError: Unexpected token in Bemba code
Missing semicolon or incorrect Bemba keyword.
fix
Ensure all statements end with semicolon and check keyword spelling.
Cannot find module 'bembajs-core' or its corresponding type declarations.
Package not installed or TypeScript types missing.
fix
Run npm install bembajs-core and ensure tsconfig includes 'node_modules/@types'.
ReferenceError: require is not defined in ES module scope
Using require() with an ESM-only package version.
fix
Switch to import syntax or set 'type': 'module' in package.json.
Error: The 'react' peer dependency is not installed.
React is required but not listed in dependencies.
fix
Run npm install react react-dom.
Upgrade
Version history
1.4.27latest on npm
Audit
Dependencies
reactrequiredPeer dependency - required for rendering Bemba components
react-domrequiredPeer dependency - required for DOM rendering
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
bembajs-core — npm install bembajs-core · libregistry