← all posts

envgraph: finding env variables without guessing

a static pass through JavaScript and TypeScript that maps declarations to the places where they are actually read.

Obzori

@obzori

  • 1 min

an environment variable is easy to declare and surprisingly hard to trace. envgraph turns that guesswork into a small, static report.

start with the syntax tree

The project walks JavaScript and TypeScript with an AST visitor. It records every declaration and every read instead of executing the application.

useful output

The command can print a small map of files, variables and possible dead configuration:

npx envgraph ./src --format=compact

The output is intentionally boring. Boring output is easier to put in CI.

Obzori

written by full-stack dev

/ related posts