@kaloka-radia-nanda/envlint
v0.1.2
Published
Tiny utility to load and validate environment variables safely
Maintainers
Readme
🔒 envlint
Tiny utility to load and validate environment variables safely in Node.js.
envlint helps you define a schema for your environment variables and ensures they exist, have the correct type, and follow basic rules before your app starts.
⚠️ Note: Envlint does NOT load
.envfiles. Usedotenvor similar.
Table of Contents
Installation
npm install @kaloka-radia-nanda/envlintBasic Usage
const { Envlint, string, number, boolean } = require("envlint");
const env = Envlint({
NODE_ENV: string({
choices: ["development", "production"],
default: "development",
}),
PORT: number({ default: 3000 }),
DEBUG: boolean({ default: false }),
API_KEY: string(),
});If a required variable is missing or invalid, Envlint will throw an error immediately.
Schema Types
string(options)
Validates string values
Options:
default: default value if env is missingchoices: allowed string values
number(options)
- Converts and validates numbers
- Throws if value is not a valid number
boolean(options)
- Converts common boolean strings (
true,false,1,0)
Defaults
If no default is provided and the environment variable is missing, Envlint will throw an error.
This makes required variables explicit and prevents silent misconfiguration.
Why Envlint?
- No magic
- No decorators
- No build step
- Small and predictable
Designed for simple Node.js projects that just want safe environment variables.
License
MIT License
© 2026 Kaloka Radia Nanda
