Skip to content

pawaretdev/envify

Repository files navigation

Envify

Instantly convert between .env and JSON formats — bidirectional, fast, and simple.

Support Further Development

GitHub Sponsors
Buy Me a Coffee

Features

  • .envJSON — Convert environment variable files to JSON
  • JSON.env — Convert JSON files to .env format
  • Format Document — Clean up .env files with Shift+Alt+F (trims whitespace, removes duplicate blank lines)
  • In-place conversion — Replace content in the current editor
  • Selection support — Select specific lines to convert only the selection
  • New tab output — Open conversion result in a new untitled tab
  • Right-click menu — Context menu shows all commands for easy back-and-forth conversion
  • Keyboard shortcuts — Fast conversion with hotkeys

Usage

Command Palette

Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) and search for:

Command Description
Envify: Convert .env to JSON Replace current content with JSON
Envify: Convert JSON to .env Replace current content with .env
Envify: Convert .env to JSON (New File) Open JSON result in a new tab
Envify: Convert JSON to .env (New File) Open .env result in a new tab

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+J / Cmd+Shift+J Convert .env → JSON
Ctrl+Alt+E / Cmd+Alt+E Convert JSON → .env

Format Document

Press Shift+Alt+F (Mac: Shift+Option+F) while editing a .env file to auto-format:

  • Trims whitespace around =KEY = valueKEY=value
  • Removes trailing whitespace on each line
  • Collapses consecutive blank lines into one
  • Ensures a trailing newline at end of file

Right-Click Menu

Right-click in the editor to see all Envify commands in the context menu.

Examples

.env → JSON

Before:

DATABASE_URL=postgres://localhost:5432/mydb
API_KEY=sk-1234567890
DEBUG=true
APP_NAME="My App"

After:

{
  "DATABASE_URL": "postgres://localhost:5432/mydb",
  "API_KEY": "sk-1234567890",
  "DEBUG": "true",
  "APP_NAME": "My App"
}

JSON → .env

Before:

{
  "DATABASE_URL": "postgres://localhost:5432/mydb",
  "API_KEY": "sk-1234567890",
  "DEBUG": "true",
  "APP_NAME": "My App"
}

After:

DATABASE_URL=postgres://localhost:5432/mydb
API_KEY=sk-1234567890
DEBUG=true
APP_NAME="My App"

Supported Formats

  • Handles quoted values (single and double quotes)
  • Handles escape sequences (\n, \t, \\, \")
  • Skips comments and empty lines in .env files
  • Nested JSON objects are stringified when converting to .env

Privacy & Security

Envify works 100% offline. Your .env secrets never leave your machine.

  • No network requests — no data is sent to any server
  • No telemetry or analytics
  • No file system access — conversion happens entirely in the editor
  • Zero runtime dependencies — no third-party code runs behind the scenes
  • Source code is open and auditable on GitHub

License

MIT

About

Instantly convert between .env and JSON formats — bidirectional, offline, zero dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors