Shared JS/C modules for the Deadlight ecosystem.
lib.deadlight is the common code layer used by Deadlight projects to avoid duplicating infrastructure across repos. It is currently required by blog.deadlight and contains modules extracted from that project as they become reusable.
This repository is public because Deadlight projects are public and depend on it. It is not yet a polished general-purpose framework; it is a practical shared library under active cleanup.
Active extraction and stabilization.
The JavaScript modules are the most mature today and are primarily shaped by blog.deadlight. The native C modules are earlier-stage, but they reflect real reuse goals across deadlight-proxy, deadmesh, and the planned vault.deadlight.
APIs may change while the library stabilizes.
lib.deadlight/
├── build/ # Android ARM64 16 KB Native Bundle
├── core/ # JavaScript modules used by Workers/blog apps
├── c/ # Native C modules and shared C experiments
├── shared/ # Shared ecosystem config/schema experiments
├── reference/ # Scratch notes and non-API reference material
└── README.md
Located under core/src/.
These modules currently support blog.deadlight and other Workers/D1-style Deadlight apps.
Current areas:
auth/— JWT helpers, password hashing, auth errorscomponents/— reusable HTML/UI components for admin, auth, posts, and usersdb/— D1 model helpers, migrations, and base model patternslogging/— shared logger utilitiesmarkdown/— markdown rendering and excerpt processingsecurity/— headers, middleware, rate limiting, and validation helpersutils/— moderation, subdomain, template, and general utility helpers
Dependencies include:
markedfor markdown parsingxssandcssfilterfor sanitizationcommanderfor CLI/helper tooling
Located under c/.
These modules are earlier-stage, but they point toward shared native infrastructure across the ecosystem.
Current areas:
auth/— auth-related headers/stubs for future native credential worknetwork/— shared networking primitives, currently includingconnection_pool.c
The connection pool module was extracted because deadmesh began as a fork of deadlight-proxy, and the two projects share native networking code. lib.deadlight is the intended home for modules that should not remain duplicated across both projects.
The C modules are not yet a stable public C API.
Deadlight is an ecosystem for publishing, proxying, and routing across unpredictable networks.
The stack has three broad layers:
- Transport:
deadlight-proxyanddeadmesh - Security:
vault.deadlight - Application:
blog.deadlight
lib.deadlight sits underneath those projects as the shared module layer. Code is moved here when reuse becomes real, not just theoretical.
git clone https://github.com/gnarzilla/lib.deadlight.git
cd lib.deadlight
npm installFor local development with blog.deadlight:
cd lib.deadlight
npm link
cd ../blog.deadlight
npm link @deadlight/corePackage names and exports are still stabilizing.
Some files in reference/ are scratch material, design notes, or context used during development. They are not part of the public API.
If a module is under core/src/, it is part of the JavaScript library surface or moving toward that role.
If a module is under c/, treat it as native shared infrastructure under active development unless documented otherwise.
- Audit actual exports and update examples accordingly
- Document which modules are currently consumed by
blog.deadlight - Remove or relocate stale scratch files
- Add tests for markdown processing
- Add tests for auth/password helpers
- Clarify package names and import paths
- Decide which
deadlight-proxy/deadmeshmodules belong inlib.deadlight - Stabilize
c/network/connection_pool - Expand native auth primitives only where needed by
vault.deadlight - Define the JS/C boundary for local credential workflows
- Standardize D1 model conventions across Workers projects
- Document security middleware usage
- Share common admin/auth components across Deadlight web apps
- Keep
lib.deadlightsmall enough to remain useful outside a monolith
MIT License. See LICENSE.