Registry / web-framework / bay-lang

bay-lang

JSON →
library1.2.2jsnpmunverified

BayLang Compiler (v1.2.2) is the core compiler for the BayLang programming language, a full-stack language that automatically splits code into backend and frontend, supporting reactivity and server-side rendering. This package compiles BayLang to Node.js. Release cadence is irregular, with recent updates adding frontend component support (1.2.2), HTML template translation (1.2.1), and async/await features (1.2). Key differentiator: single codebase for both client and server with automatic platform adaptation. Designed for web application, website, and CRM development with an integrated constructor and widget ecosystem.

npm install bay-lang
INSTALL
IMPORT
SIG · BAY-LANG
B
bay-lang
web-frameworkjavascriptv1.2.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.

default
import bayLang from 'bay-lang'
const bayLang = require('bay-lang')
ESM default export; CommonJS require may not work in newer versions.
compile
import { compile } from 'bay-lang'
import compile from 'bay-lang/compile'
Named export; do not use subpath imports.
version
import { version } from 'bay-lang'
import { VERSION } from 'bay-lang'
Property is lowercase; also accessible as bayLang.version.
Runtime
import { Runtime } from 'bay-lang'
Runtime is a named export for runtime library; not default.

Compiles a simple BayLang function to Node.js JavaScript.

import { compile, version } from 'bay-lang'; import fs from 'fs'; const sourceCode = ` function greet(name: string) { return "Hello, " + name; } `; try { const result = compile(sourceCode, { target: 'nodejs' }); console.log('Compiled JS:', result.code); console.log('BayLang version:', version); } catch (err) { console.error('Compilation failed:', err.message); }
bay --version
Debug
Known issues
breakingVersion 1.0 removed legacy runtime core; existing projects must update imports.
fix
Use new Runtime from 'bay-lang' instead of separate 'bay-lang-runtime' package.
affects: >=1.0
deprecatedThe CLI command 'bay-lang-nodejs version' is deprecated; use 'bay-lang version'.
fix
Use 'npx bay-lang version' or call programmatically.
affects: >=1.2
gotchaESM-only from version 1.0; CommonJS require() will fail.
fix
Use import statements or dynamic import().
affects: >=1.0
breakingVersion 0.7.0 changed lambda syntax from 'fn' to 'pure' for functions.
fix
Replace 'fn' keyword with 'pure' in BayLang source.
affects: >=0.7.0
gotchaBayLang compiler requires Node.js >=14; older versions may have runtime issues.
fix
Upgrade Node.js to version 14 or higher.
affects: >=1.0
Errors
Common errors & fixes
Cannot find module 'bay-lang'
Package not installed or ESM import used in CommonJS environment.
fix
Run 'npm install bay-lang' and use dynamic import: 'const bayLang = await import('bay-lang');'
TypeError: bayLang.compile is not a function
Default import instead of named import for compile.
fix
Use 'import { compile } from 'bay-lang';' instead of default import.
SyntaxError: The requested module 'bay-lang' does not provide an export named 'compile'
Using named import with a version that exports differently (pre-1.0).
fix
Check package version; upgrade to >=1.0 or use default import 'import bayLang from 'bay-lang'' then bayLang.compile.
Error: Unsupported target 'react'
Only 'nodejs' and 'php' targets supported; 'react' is not valid.
fix
Use target 'nodejs' for frontend or 'php' for backend.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
16
Amazon
2
OpenAI (training)
1
Resources