𝗗𝗮𝘆 𝟭𝟮 𝗼𝗳 𝗠𝘆 𝗧𝘆𝗽𝗲𝗦𝗰𝗿𝗶𝗽𝘁 𝗦𝗽𝗿𝗶𝗻𝘁 — 𝗖𝗟𝗜 𝗡𝗼𝘁𝗲𝘀 𝗔𝗽𝗽 (𝗡𝗼𝗱𝗲.𝗷𝘀 + 𝗧𝗦) I built a CLI Notes App using Node.js + TypeScript, focusing on how types behave in real execution — not just inside tutorials. 𝗖𝗼𝗻𝗰𝗲𝗽𝘁𝘀 𝗔𝗽𝗽𝗹𝗶𝗲𝗱 • fs module for file handling • Async I/O with proper typing • Strongly typed CLI arguments • Module-based architecture • Command handling with the commander 𝗙𝗲𝗮𝘁𝘂𝗿𝗲𝘀 • Add, list, delete, and search notes • JSON-based persistence • Clean, colored CLI output using chalk 𝗪𝗵𝗮𝘁 𝗧𝗵𝗶𝘀 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗥𝗲𝗶𝗻𝗳𝗼𝗿𝗰𝗲𝗱 TypeScript delivers the most value when inputs are unpredictable and side effects exist. Typing CLI arguments, file I/O, and async flows forced me to: • Model data intentionally • Handle edge cases early • Refactor confidently with compiler support #TypeScript #NodeJS #CLI #LearningInPublic #SoftwareEngineering #JavaScript #DeveloperJourney
More Relevant Posts
-
🛑 Stop making all your TypeScript interface properties optional. If you use TypeScript, you have probably been tempted to just slap a ? on a property to make the compiler stop yelling at you. id?: string; name?: string; We do this because a User in the database has an id, but a User being submitted in a registration form doesn't have an id yet. So we make it optional to share the same interface. This is a massive trap. 🪤 When you make properties optional, you are destroying your type safety. You will spend the rest of your app writing defensive code: if (user.id !== undefined) { ... }. The Fix: Strict Base Interfaces + Utility Types. ✨ Define your core interface as the absolute, strict truth (no optional fields unless they are truly optional). Then, let TypeScript do the heavy lifting using Omit and Pick. Why this wins: ✅ Zero Guesswork: If a function requires a UserCardProps, you know with 100% certainty that name and email will be there. No undefined checks needed. ✅ Single Source of Truth: If you add a new required property to your base User, your derived utility types automatically inherit it. ✅ Self-Documenting: Reading Omit<User, 'id'> instantly tells the next developer exactly what this object is meant for. Stop fighting the TypeScript compiler. Let Utility Types do the work for you. 🧠 Are you using Pick and Omit, or are you still living in the Optional wild west? 👇 #TypeScript #JavaScript #WebDevelopment #Frontend #ReactJS #CleanCode #SoftwareEngineering
To view or add a comment, sign in
-
-
🚨 Node.js is NOT actually single-threaded One of the biggest misconceptions I had early in backend development: “Node.js can only handle one thing at a time.” Not true. Node runs JavaScript on a single thread but under the hood it uses: Event Loop Worker Threads libuv thread pool Meaning: - File system operations - Database queries - Network requests are executed outside the main thread. The real bottleneck isn’t Node itself, it’s CPU-blocking code. 💡 Lesson: Node excels at I/O-heavy systems, not CPU-heavy computation. That’s why companies use Node for APIs but offload heavy processing to workers or services. 💬 Question: What surprised you most when you learned how Node actually works? #NodeJS #BackendEngineering #SystemDesign #JavaScript #FullStackDev #SoftwareEngineering #TechInsights
To view or add a comment, sign in
-
-
Most developers write try/catch in every single async function. There's a better way. I discovered the await-to-js pattern a while back, and it completely changed how I handle errors in Node.js and TypeScript. Instead of this mess: try { ... } catch(e) { console.log("error") } try { ... } catch(e) { console.log("error") } try { ... } catch(e) { console.log("error") } You write one tiny helper once, and every async call returns a clean [error, data] tuple. No nesting. No swallowed errors. No repeated boilerplate. The library is literally called await-to-js (npm). It has 3.5k stars. 400 bytes. Life-changing. If you're building any Node.js, Next.js, or backend API, add this to your utils file today. You'll wonder how you coded without it. 💬 Drop a comment if you use a different error handling pattern — always curious what others do. #JavaScript #NodeJS #CleanCode #WebDev #Programming #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
-
Today I explored one of the most powerful concepts in TypeScript — Generics. Generics allow us to write reusable and type-safe functions that can work with different data types without repeating code. Instead of creating separate functions for numbers, strings, or booleans, generics let us write one flexible function that works for all types. Here are some of the things I practiced today: ✔ Creating generic functions using <T> ✔ Building reusable functions that work with multiple data types ✔ Working with arrays using generics ✔ Understanding how generics improve code flexibility and maintainability This simple concept makes code cleaner, reusable, and scalable, which is why TypeScript is widely used in modern applications. I’m documenting my journey as I continue improving my skills in TypeScript, JavaScript, and backend development. #TypeScript #WebDevelopment #LearningInPublic #JavaScript #SoftwareEngineering
To view or add a comment, sign in
-
-
Today I strengthened my understanding of backend fundamentals while working with Node.js and the File System module. Here’s what I focused on: • How to properly read and understand JavaScript error messages • Debugging errors like: “Cannot read properties of undefined” • Understanding why .push() only works on arrays • The complete data flow: JSON file → readFile → fileContent → JSON.parse → JS object → modify → JSON.stringify → writeFile • The difference between using Arrays vs Objects in JSON structure • Why products.json is an array (list of items) • Why cart.json is an object (stores multiple related properties like products and totalPrice) The biggest takeaway today wasn’t just fixing errors — it was learning how to read errors calmly and think logically about data structure and flow. Backend development is starting to make more sense when you understand what’s happening behind the scenes. Small progress. Strong foundation. 🚀 #NodeJS #BackendDevelopment #JavaScript #LearningInPublic #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Deep-dived into Node.js architecture today — here's what every backend developer should understand: Node.js isn't just JavaScript on a server. It's a powerful orchestration of: ⚙️ V8 Engine — executes JS on the main thread 📡 libuv — handles async I/O and the thread pool 🔗 C++ Bindings — bridge your JS code to the OS 🔄 Event Loop — schedules callbacks without blocking The full execution flow: 𝗝𝗦 𝗰𝗼𝗱𝗲 → 𝗡𝗼𝗱𝗲 𝗔𝗣𝗜 → 𝗖++ 𝗯𝗶𝗻𝗱𝗶𝗻𝗴 → 𝗹𝗶𝗯𝘂𝘃 → 𝗢𝗦 → 𝗰𝗮𝗹𝗹𝗯𝗮𝗰𝗸 𝗾𝘂𝗲𝘂𝗲 → 𝗲𝘃𝗲𝗻𝘁 𝗹𝗼𝗼𝗽 → 𝗩𝟴 For CPU-intensive tasks? Worker threads spin up isolated V8 instances — real parallelism, zero main thread blocking. Understanding this architecture is the difference between writing Node.js code and writing high-performance server applications. #NodeJS #JavaScript #BackendDevelopment #SoftwareEngineering #WebDevelopment
To view or add a comment, sign in
-
🚀 TypeScript 6.0 RC is here — and it’s a BIG transition release! Microsoft just announced TypeScript 6.0 Release Candidate, and it’s more than just another version update. Here are some key highlights developers should know: 🔹 Bridge between TS 5.x and TS 7 TypeScript 6.0 will likely be the last version based on the current JavaScript codebase. TypeScript 7 is being rewritten in Go for faster performance and better multi-threading. 🔹 New ES2025 Support TypeScript now supports the "es2025" target with new APIs like: - "RegExp.escape" - "Promise.try" - Iterator improvements 🔹 Temporal API Types Built-in support for the upcoming Temporal date/time API, making time handling in JavaScript much more reliable. 🔹 Map Upsert Methods New methods added to Map / WeakMap: - "getOrInsert" - "getOrInsertComputed" These simplify common patterns where you check if a key exists and insert a default value. 🔹 Subpath imports with "#/" Node.js style internal imports are now cleaner: import utils from "#/utils"; 🔹 New flag: "--stableTypeOrdering" Helps prepare projects for TypeScript 7’s parallel type checking. 📦 Install the RC: npm install -D typescript@rc TypeScript 6 is not just an upgrade — it’s the foundation for the future TypeScript 7 compiler. If you're using Next.js, React, or Node, it's a good time to start testing your projects with TS 6. #typescript #javascript #webdevelopment #nextjs #programming
To view or add a comment, sign in
-
-
The TypeScript compiler has been written in JavaScript since day one. That's ending. TypeScript 6.0 RC came out last week, and while the changelog is packed, the real headline is what it represents: this is the last major release before the compiler gets rewritten in Go for version 7.0. Native speed. Parallel type checking. A fundamentally different engine under the hood. 6.0 is the bridge. It's designed to get your codebase ready so the jump to 7.0 doesn't break everything at once. A few highlights worth knowing about: "strict" is now true by default. Sounds small, but it's a statement - the ecosystem has moved on from "maybe we'll add types later". Temporal API types are included. For anyone who's ever tried to do timezone math in JS and questioned their career choices - there's finally a proper date/time API making its way into the language, and TS now has the types ready. ES2025 support brings things like RegExp.escape and Map.getOrInsert - small quality-of-life wins that remove boilerplate you've been copy-pasting for years. And then there's the deprecation list. Old module resolution modes, legacy targets, options that won't exist in 7.0. The team added an ignoreDeprecations escape hatch for now, but that disappears with the next major version. My take: don't sleep on this one. It's tempting to wait for 7.0 since that's the "exciting" release, but 6.0 is where you do the prep work. Upgrading in two big jumps is always worse than one smooth transition. Link to the full announcement below. https://lnkd.in/eJTpEu_j #javascript #typescript #dev #microsoft #softwareengineering
To view or add a comment, sign in
-
I used Node.js for a long time… but today I finally explored what happens behind the scenes. ⚙️ Node.js isn’t just JavaScript running on a server. It’s powered by a few powerful components: • V8 Engine → Converts JavaScript into machine code • Event Loop → Handles asynchronous operations efficiently • libuv → Enables non-blocking I/O and manages the thread pool • Event Queue → Stores incoming requests • Thread Pool → Executes heavy tasks in the background All these pieces work together to make Node.js fast, scalable, and non-blocking. Hitesh Choudhary | Piyush Garg | Akash Kadlag | Jay Kadlag Understanding the internal architecture makes you appreciate why Node can handle thousands of concurrent requests with ease. What backend concept are you exploring this week? 🚀 #NodeJS #BackendDevelopment #JavaScript #WebDevelopment #EventLoop #SoftwareEngineering #CodingJourney #chaicode
To view or add a comment, sign in
-
-
TypeScript Type vs Interface Use interface → For Contracts & Object Structure ✅ Service contracts ✅ Domain models ✅ DTOs ✅ Class implementations export interface PaymentProvider { charge(amount: number): Promise<boolean> refund(id: string): Promise<boolean> } class StripeProvider implements PaymentProvider {} interface User { id: string email: string } 𝗜𝗡𝗧𝗘𝗥𝗙𝗔𝗖𝗘: Use when defining object shape or implementation contract. Use type → For Unions, States & Advanced Types ✅ Union types ✅ Event models ✅ API response wrappers ✅ Utility & composition types type UserRole = "ADMIN" | "USER" | "SUPPORT" type ApiResponse<T> = | { success: true; data: T } | { success: false; error: string } type AdminUser = User & { permissions: string[] } 𝗧𝗬𝗣𝗘: Use when modeling states, variations, or type logic. 🎯 Simple Rule Contract or extendable object → interface Union or advanced typing → type #TypeScript #JavaScript #BackendDevelopment #WebDevelopment #SoftwareArchitecture #CleanCode #NestJS #NodeJS #Programming
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