今日已更新 178 条资讯 | 累计 22368 条内容
关于我们

Showoff Saturday: I built envlint, a zero-dependency CLI to validate env files and diff them safely without leaking secrets

/u/7xmohamedd 2026年05月30日 08:38 2 次阅读 来源:Reddit r/webdev

Hello developers, A common issue in team workflows is configuration drift. Staging crashes because of a missing env variable, or a teammate spends hours debugging because they did not get the updated configuration. The typical workaround is sharing env files over chat apps to compare them, which is a major security risk. To solve this, I built envlint. It is an open-source tool written in pure Node.js with zero npm dependencies. How it works: - It creates a schema file (.env.schema) with key names, expected types (string, number, boolean, url, port), and defaults. - The schema contains no secrets and is committed to Git. - Developers run validation locally or in CI/CD. - It includes a diff command to compare keys across environments (e.g. .env and .env.staging). It prints key presence but suppresses all values so that terminal logs remain secure. Technical Details: - Language: JavaScript (Node.js standard library) - Dependencies: Zero - Size: Under 50KB What I learned building this: I spent a lot of time writing a custom parser in JavaScript instead of using regex or third-party parsers like dotenv. Writing a custom parser allowed me to handle edge cases like comments, multiline values, and inline types much more reliably. The project is fully open source under the MIT license: https://github.com/7xmohamed/envlint I would love to hear how you currently manage environment verification in your teams. submitted by /u/7xmohamedd [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文