@codelockr/runtime
v1.0.2
Published
CodeLockr runtime for decrypting and executing CLR-protected JavaScript files.
Readme
CodeLockr JS Runtime
Enterprise-grade runtime for executing AES-256-GCM encrypted JavaScript, TypeScript, and Next.js server-side source files.
Installation
npm install @codelockr/runtimeThe runtime is also bundled inside every
.clr.jsfile, so no additional setup is required at runtime.
How It Works
Encrypted .clr.js files are self-contained — they include the runtime and decrypt themselves in memory when loaded. All you need is a regular .js or .ts file that requires or imports the encrypted file.
Usage
Node.js / CommonJS
// index.js
require('./modules/dashboard.clr.js');TypeScript / ESM
// index.ts
import './modules/dashboard.clr.js';Next.js — API Route
// app/api/dashboard/route.ts
import './modules/dashboard.clr.js';Note: Always load
.clr.jsfiles in a server-side context only — API routes, Server Components, or Node.js scripts. Never import them in Client Components.
Important: Never place
.clr.jsfiles inside apublic/or statically served directory.
Deployment Checklist
- Run
npm installin your project directory - Place
.clr.jsfiles outside any public or statically served folder - Load them via a regular
.jsor.tsentry file - For Next.js: only load inside API routes or Server Components
Security Features
- AES-256-GCM encryption
- HMAC-SHA256 integrity validation
- Fragmented key reconstruction
- Temporary decryption to memory (no disk writes)
- Self-contained — runtime is bundled inside the encrypted file
License
MIT License
