Skip to content
Abhijeet Kumar edited this page Nov 20, 2026 · 1 revision

env-saaf Wiki

Welcome to the env-saaf documentation wiki.

env-saaf is a zero-dependency environment variable validator for Node.js. It fails fast at startup with one clear error listing every problem, and returns typed values — so DEBUG=false is a real boolean and PORT is a real number, not strings that bite you in production.

Quick start

npm install env-saaf
const { validateEnv } = require('env-saaf');

const env = validateEnv({
  PORT:    { type: 'port', required: true },
  DEBUG:   { type: 'boolean', default: false },
  API_URL: { type: 'url', required: true },
});

// env.PORT is a number, env.DEBUG is a real boolean

Wiki pages

Links

Clone this wiki locally