npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@su5kk/envchecker

v1.0.0

Published

CLI tool to validate environment variables in Kubernetes deployments against reference files

Readme

EnvChecker

A CLI tool written in Typescript to check environment variables consistency for your deployments.

Features

  • Multi-format Support: Parse environment variables from .env files and Jenkins pipeline files
  • Variable Validation: Cross-reference deployment environment variables against allowed lists
  • Schema Validation: Strict YAML validation using Zod for deployment files

Installation

Prerequisites

  • Node.js 18+

Quick Start (Recommended)

# Run directly without installation
npx @su5kk/envchecker <deployment-file> <env-file>

Global Installation

# Install once, use anywhere
npm install -g @su5kk/envchecker

# Then use directly
envchecker <deployment-file> <env-file>

Development Installation

# Clone and build from source
git clone https://github.com/timtursunov/envchecker.git
cd envchecker
npm install
npm run build

Usage

Basic Usage

# Using npx (recommended)
npx @su5kk/envchecker <deployment-file> <env-vars-file>

# If installed globally
envchecker <deployment-file> <env-vars-file>

# Development mode
npm start <deployment-file> <env-vars-file>

Examples

Validate against .env file

npx @su5kk/envchecker deployment.yml .env

Validate against Jenkinsfile

npx @su5kk/envchecker deployment.yml Jenkinsfile

Sample Output

npm start test/fixtures/deployments/test-deployment.yml test/fixtures/jenkinsfiles/Jenkinsfile.simple

--- Container: web-server ---
$LOG_LEVEL -> ✅ Exists
$DATABASE_URL -> ✅ Exists
$API_BASE_URL -> ✅ Exists
$MISSING_VARIABLE -> ❌ DOES NOT EXIST

--- Container: background-worker ---
$REDIS_URL -> ✅ Exists
$DEBUG_MODE -> ✅ Exists
$REPLICA_COUNT -> ✅ Exists

Supported File Types

Environment Files (.env)

Parses standard .env format:

# Comments are ignored
LOG_LEVEL=info
DATABASE_URL=postgres://localhost:5432/mydb
API_TOKEN=secret123

Jenkins Pipeline Files

Extracts variables from env.VAR_NAME assignments:

pipeline {
  stages {
    stage('Deploy') {
      steps {
        script {
          env.LOG_LEVEL = 'debug'
          env.DATABASE_URL = 'postgres://db.example.com'
          env.API_TOKEN = 'production-token'
        }
      }
    }
  }
}

Kubernetes Deployment Files

Validates environment variables in container specs:

apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
        - name: app
          env:
            - name: LOG_LEVEL
              value: $LOG_LEVEL          # ✅ Will be validated
            - name: API_TOKEN  
              value: "$API_TOKEN"        # ✅ Will be validated
            - name: STATIC_VALUE
              value: "not-a-variable"    # ⏭️ Ignored (not a variable)

Development

Available Scripts

# Clean build artifacts
npm run clean

# Build the project
npm run build

# Run in development mode
npm start <args>

# Run tests
npm test

# Watch mode for development
npm run test:watch

Architecture

The tool uses the Strategy Pattern to handle different file types:

  • EnvFileParsingStrategy: Parses .env files to extract variable names
  • JenkinsfileParsingStrategy: Parses Jenkinsfiles to extract env.VAR_NAME patterns

Validation flow:

  1. Parse deployment YAML and validate structure with Zod
  2. Extract environment variables from container specifications
  3. Select appropriate parsing strategy for reference file
  4. Cross-reference variables and report missing ones

Testing

  • Integration Tests: Test end-to-end CLI behavior with various file combinations
  • Test Fixtures: Organized test data in test/fixtures/ directory

Run tests to verify functionality:

npm test

License

ISC License - see package.json for details.