---
title: "#environment-variables Code Snippets"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/codesnippets/tags/environment-variables
---

[All Tags](/codesnippets/tags)

2Snippets

# #Environment variables

[Home](/)›[All Snippets](/codesnippets)›[All Tags](/codesnippets/tags)›[Environment variables](/codesnippets/tags/environment-variables)

Tag

# #Environment variables

[![Node.js Environment Variable Validation with Zod at Startup](/_astro/hero.DEQ8-R8h_1M1QX3.webp)](/codesnippets/post/nodejs-env-validation-zod-startup)

## [Node.js Environment Variable Validation with Zod at Startup](/codesnippets/post/nodejs-env-validation-zod-startup)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Nodejs](/codesnippets/categories/nodejs)
-   [Typescript](/codesnippets/categories/typescript)
-   [Backend](/codesnippets/categories/backend)
-   Published: 27 May, 2026

Most Node.js apps treat process.env like a trusted friend. You reach into it whenever you need a value, assume the key is there, assume it's spelled right, and assume the string is actually the type

[#Node.js](/codesnippets/tags/nodejs)[#TypeScript](/codesnippets/tags/typescript)[#Zod](/codesnippets/tags/zod)+5 tags

[Typescript](/codesnippets/typescript)

[View Code](/codesnippets/post/nodejs-env-validation-zod-startup)

[![Essential Bash Variables for Every Script](/_astro/hero.B4bDowyY_YQpD7.webp)](/codesnippets/post/essential-bash-variables)

## [Essential Bash Variables for Every Script](/codesnippets/post/essential-bash-variables)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Shell scripting](/codesnippets/categories/shell-scripting)
-   [Devops](/codesnippets/categories/devops)
-   Published: 26 Dec, 2025

Overview Quick Tip You know what's worse than writing scripts? Writing scripts that break every time you move them to a different machine. Let's fix that with some built-in Bash variables tha

[#Bash](/codesnippets/tags/bash)[#Shell Scripting](/codesnippets/tags/shell-scripting)[#Linux](/codesnippets/tags/linux)+4 tags

[Bash](/codesnippets/bash)

[View Code](/codesnippets/post/essential-bash-variables)
