Why I Built a Lightweight Alternative to dotenv

작성자

카테고리:

← 피드로
DEV Community · opensource-crypto · 2026-07-11 개발(SW)

opensource-crypto

The Problem

dotenv is the standard for loading .env files in Node.js — but it has more features than most projects need, and the dependency tree keeps growing.

I wanted something minimal: zero dependencies, tiny API, and fast.

env-fast

env-fast is a zero-dependency .env loader with a simple API:

const env = require(‘env-fast’);
const result = env.load();
console.log(result); // { loaded: true, path: ‘.env’, variables: 12 }

Features

  • Zero dependencies
  • Variable expansion (${VAR} syntax)
  • Custom paths
  • TypeScript-friendly
  • Under 2KB

Install

npm install env-fast

Usage

// .env
PORT=3000
DATABASE_URL=postgres://localhost/mydb

// index.js
const env = require(‘env-fast’);
env.load();
console.log(process.env.PORT); // 3000

When to Use

  • Side projects needing simple env loading
  • Serverless functions where size matters
  • Any project wanting zero dependency overhead

GitHub: https://github.com/opensource-crypto/env-fast
npm: https://www.npmjs.com/package/env-fast

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다