Just published my first npm package! Introducing "typed-env" — a lightweight, type-safe environment variable validator for Node.js & TypeScript. 💡 Problem: Working with process.env is error-prone: - Missing variables - Wrong types - Runtime crashes ✅ Solution: typed-env validates and types your environment variables at startup — no surprises later. ✨ Features: - Type-safe env variables - Runtime validation - Enum support (e.g. NODE_ENV) - Zero dependencies ⚡ Example code: const env = createEnv({ PORT: "number", NODE_ENV: ["development", "production"], }); 🔗 Check it out: https://lnkd.in/gZtPUQUF #javascript #typescript #nodejs #opensource #webdevelopment
Introducing typed-env: Type-Safe Node.js Environment Variables
More Relevant Posts
-
I still remember the old npm ritual: install a package → hit type errors → hunt down @types/* → repeat 😄 If you’re returning to JS/TS after some time, you’ll notice a big change… 👉 You don’t need @types as much anymore. So what changed? Over the last few years, the ecosystem quietly evolved: • Most modern libraries now ship with built-in TypeScript types • TypeScript is no longer “optional” — it’s the default • Tooling (Vite, tsup, etc.) makes generating types effortless • Newer runtimes are becoming more TS-friendly In short: 📦 Libraries now come “type-ready” out of the box You’ll still see @types/* for: – Older JS libraries – Node/test environments – Some community-maintained packages But the constant back-and-forth? Mostly gone. #TypeScript #JavaScript #WebDevelopment #NodeJS #DeveloperExperience #CodingLife #SoftwareEngineering
To view or add a comment, sign in
-
We migrated 200,000 lines of production JavaScript to strict TypeScript — with zero downtime, over 4 months, while shipping features every sprint. Not a weekend hackathon. A systematic 5-phase strategy on a 6-year-old Node.js monolith serving 50K daily active users. The results after 4 months: → Type-related bugs: -85% → New developer onboarding time: -50% → CI catch rate: ~40% → ~95% → Refactoring confidence: 3.2/10 → 8.1/10 The killer insight? strictNullChecks alone found 3 production bugs we didn't know about. One was a race condition hiding for months. I wrote the full playbook — from the tsconfig.json setup to the CI guardrails that prevent regression. Read the full case study: https://lnkd.in/dPD5spCJ What's your biggest fear about migrating a legacy JS codebase to TypeScript? #TypeScript #JavaScript #Migration #SoftwareArchitecture #WebDevelopment #NodeJS #CleanArchitecture #DeveloperProductivity
To view or add a comment, sign in
-
-
Node.js Module System I’ve published a new blog post exploring the Node.js Module System, covering ES6 Modules vs CommonJS, real-world use cases, module caching, and key concepts that every backend developer should know. If you’re learning Node.js or want to strengthen your fundamentals, this guide will help you understand how modules bring structure, scalability, and maintainability to applications. 👉 Read the full article here: https://lnkd.in/gfAaFK5d #NodeJS #JavaScript #BackendDevelopment #WebDevelopment #Programming #SoftwareEngineering
To view or add a comment, sign in
-
-
Introducing chain-validate, a chainable validation library designed for JavaScript and TypeScript. Reasons for its creation include: - Combining validation and sanitization in a single chain - Collecting all errors instead of stopping at the first one - Returning structured results without throwing errors - Having zero dependencies - Maintaining a tiny bundle size Here’s a quick example: import { v } from 'chain-validate'; const userSchema = v.object({ email: v.string().required().trim().lowercase().email(), age: v.number().optional().coerce().min(18), }); const result = userSchema.validate({ email: ' KENIL@EXAMPLE.COM ', age: '21', }); result.value comes back already cleaned and typed. You can find it on npm: https://lnkd.in/dQPR_BPG Documentation is available at: https://lnkd.in/d_cYEWWz Check out the GitHub repository: https://lnkd.in/dR92DFAy I would appreciate feedback from JavaScript and TypeScript developers who are currently using Zod, Yup, or Joi. #JavaScript #TypeScript #OpenSource #WebDevelopment #NodeJS
To view or add a comment, sign in
-
Node.js Event Loop — One Concept Every Developer Should Know 🧠 Many developers get confused about this: Why does Promise run before setTimeout? Example 👇 console.log("Start"); setTimeout(() => console.log("Timeout"), 0); Promise.resolve().then(() => console.log("Promise")); console.log("End"); Output: Start → End → Promise → Timeout Why? Because JavaScript has 2 queues: ✔ Microtask Queue (Promises, async/await) ✔ Macrotask Queue (setTimeout, setInterval) Rule: 👉 Microtasks run before Macrotasks This is why Promise executes before setTimeout, even if timeout is 0ms. Understanding this helps in: ✔ Debugging async issues ✔ Writing better Node.js code ✔ Handling real-time applications 👇 Did this confuse you before learning event loop? #nodejs #javascript #eventloop #backenddeveloper #webdevelopment
To view or add a comment, sign in
-
Day 65/100 – Starting with Node.js 🚀 Learned: What Node.js is and how it allows JavaScript to run outside the browser Basic idea of the Event Loop and how Node handles multiple requests efficiently Introduction to Express and how it simplifies backend development What stood out: Node.js doesn’t work like traditional synchronous systems. Instead of waiting, it handles tasks asynchronously using the event loop, making it fast and scalable. #NodeJS #BackendDevelopment #JavaScript #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Understanding Node.js Internals: Event Loop & Thread Pool This week, I took a deeper dive into how Node.js actually works behind the scenes — and it completely changed how I think about asynchronous code. 🔹 JavaScript in Node.js runs on a single thread 🔹 Yet it handles multiple tasks efficiently using the Event Loop 🔹 Heavy operations are offloaded to the Thread Pool (via libuv) Some key takeaways: Event Loop manages execution in phases (Timers, I/O, setImmediate, etc.) setTimeout(0) is not truly immediate setImmediate() behaves differently inside vs outside I/O process.nextTick() runs before the event loop even starts Understanding these concepts makes async behavior much more predictable and helps write better backend code. Would love to hear your thoughts or corrections 🙌! Blog Link : https://lnkd.in/gxBA4DeT #JavaScript #WebDev #LearnInPublic #Blog #libuv #EventLoop #ThreadPool #ChaiCode Thanks to Hitesh Choudhary, Piyush Garg, Jay Kadlag, Akash Kadlag for guidance 😊
To view or add a comment, sign in
-
-
TypeScript 6.0 is your final warning TypeScript 6.0 has been released as the last version built on its JavaScript codebase, serving as a transition before TypeScript 7.0 introduces a Go-based compiler with native speed and multi-threaded type checking. Key changes include strict mode enabled by default, module defaulting to esnext, target floating to the current ES spec (es2025), and types defaulting to an empty array — a change that may break many projects but promises 20–50% speed improvements. New features include built-in Temporal API types and Map.getOrInsert support. Several legacy options like outFile, baseUrl, and AMD/UMD/SystemJS targets are deprecated or removed. The newsletter also covers pnpm 11 beta, Zero 1.0 stable release, a React useState closure gotcha, and various other JavaScript ecosystem links
To view or add a comment, sign in
-
-
🚀 `queueMicrotask()` A tiny JS feature most devs ignore Want something to run after current code but before setTimeout? 👉 Use `queueMicrotask()` js console.log("Start"); queueMicrotask(() => console.log("Microtask")); console.log("End"); Output: Start End Microtask --- 💡 Why it matters: • Runs before macrotasks (setTimeout) • More direct than `Promise.resolve().then()` • Useful for precise async control --- 🎯 Rule: 👉 Sync → Microtasks → Macrotasks --- Small API… But big impact once you understand the event loop ⚡ #javascript #nodejs #webdevelopment #async #eventloop
To view or add a comment, sign in
-
-
🚀 Day 2/30 – JavaScript Challenge LeetCode Problem: 2620 – Counter Today I learned about one of the most important concepts in JavaScript Closures. 🔹 Concept Explained: The inner function remembers the variable number even after the outer function has finished execution. This is called a closure. 🔹 Key Learnings: ✅ Closures help maintain state without global variables ✅ Useful in counters, ID generators, and real-world applications ✅ number++ returns the current value, then increments it #Leetcode #Day2 #JavaScript #Developers #Frontend
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development