Modules
Bnlang ships with a batteries-included standard library — file I/O, HTTP server and client, templating, four database drivers, crypto, WebSockets, and more. Every module on this page is importable out of the box, no installation needed:
import "io" as io;
import "web" as web;
import "json" as json;
Every module also has a Bangla alias — import "ফাইল", import "ওয়েব", import "জেসন" resolve to the same Module instances. See Bilingual aliases for the full mapping.
Core
| Module | Purpose |
|---|---|
sys | Process info — argv, env, cwd, exit. |
io | File I/O — sync, async, and streaming. |
path | Cross-platform path manipulation. |
timers | set / interval for deferred and repeated callbacks. |
time | Clocks, calendar conversion, ISO 8601. |
Asynchronous
| Module | Purpose |
|---|---|
Future | Built-in async value + wait keyword. The primary way to compose async work. |
Utilities
| Module | Purpose |
|---|---|
log | Leveled logging. |
dotenv | Parse .env files. |
cli | Declarative CLI argument parsing. |
uuid | Generate and validate UUIDs. |
Data
| Module | Purpose |
|---|---|
json | Encode and decode JSON. |
csv | Parse and emit CSV. |
regex | Regular expression matching, replacement, splitting. |
Crypto, math, compression
| Module | Purpose |
|---|---|
crypto | Hashing, HMAC, base64/hex, secure random. |
random | Non-cryptographic RNG. |
math | Trig, logs, rounding, list aggregations. |
zlib | gzip / deflate compression. |
Network (low level)
| Module | Purpose |
|---|---|
net | TCP sockets. |
dns | Hostname resolution and reverse lookup. |
tls | TLS-encrypted sockets. |
url | URL parsing and query-string serialization. |
HTTP / Web
| Module | Purpose |
|---|---|
web | HTTP/HTTPS server framework with routing and middleware. |
request | Axios-style HTTP client. |
ws | WebSocket server. |
cookie | Parse and build cookies and Set-Cookie headers. |
session | Session middleware. |
multipart | multipart/form-data encode/decode. |
template | Jinja-flavored template engine. |
Database
| Module | Purpose |
|---|---|
sqlite | Embedded SQLite. |
pg | PostgreSQL client. |
mysql | MySQL / MariaDB client. |
mongo | MongoDB client. |
Process & test
| Module | Purpose |
|---|---|
exec | Spawn child processes. |
test | Built-in test framework. |