🚀 Chai aur TypeScript – Day 14 Today I learned about Type Declarations and how to use them with external libraries. 🔑 Key Learnings: • .d.ts files → provide type definitions (no runtime code) • @types → install types for external libraries • Used Axios with Generics for type-safe API responses • Handled errors properly using isAxiosError • import type → used for type-only imports • Compared Fetch vs Axios for API handling 💡 Big Insight: Proper type definitions make working with APIs safer and improve developer experience #ChaiAurTypescript #TypeScript #JavaScript #LearningInPublic #DeveloperJourney #ChaiCode Hitesh Choudhary Chai Aur Code
Type Declarations in TypeScript with Axios and @types
More Relevant Posts
-
Chai aur TypeScript – Day 11 🚀 Today I learned about Arrays, Tuples, and Enums in TypeScript. 🔑 Key Learnings: • Arrays → define types for elements • readonly → prevent modification • Tuples → fixed types with strict order • Can also be made readonly • Enums → define a fixed set of values • Useful for controlled options 💡 Big Insight: Using strict data structures makes code more predictable and safe #ChaiAurTypescript #TypeScript #JavaScript #LearningInPublic #DeveloperJourney #ChaiCode Hitesh Choudhary Chai Aur Code
To view or add a comment, sign in
-
-
👩💻 We built this in bootcamp with a professor walking us through it. I then decided to rebuild and upgrade it alone. The original was vanilla JavaScript + the OMDB API. It worked, but it was guided every step of the way. ⚙️ This time I upgraded it to React & TypeScript figuring out on the way what to change and why. ✨ Additional features that I added: – Favourites saved directly on the same page via localStorage – TypeScript to keep the data handling clean and intentional Turns out the best challenge after finishing a bootcamp is going back and doing it again, without a safety net. 🔗 Link: https://lnkd.in/eSXMHEKv #developerjourney #react #typescript #javascript
To view or add a comment, sign in
-
-
How I got TypeScript 7.0 running in an afternoon. Install it alongside your current setup: npm install -D @typescript/native-preview@beta Run tsgo instead of tsc. Same flags. Start with: npx tsgo --version npx tsgo --build Grab the TypeScript Native Preview extension for VS Code — same speed boost in the editor. Fix the config breaks. TS 7.0 turns every 6.0 deprecation into a hard error. The ones that bit me: rootDir now defaults to ./ — add "rootDir": "./src" if your tsconfig sits outside src types defaults to [] — list @types packages explicitly: "types": ["node", "jest"] strict is true by default gone: target: es5, baseUrl, module: amd/umd/systemjs, downlevelIteration Don't flip the switch in one go. Add tsgo as a parallel CI job next to tsc, compare output for a few days, then swap. One thing that tripped me up: the programmatic API isn't stable until 7.1, so typescript-eslint and anything else importing from "typescript" directly may need the @typescript/typescript6 compat package for a bit. The ~10x speedup is real. Type-checking that keeps up with the editor is the part I didn't expect to feel so different. #typescript #golang
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
-
Why did 90% of big tech switch to TypeScript? JavaScript is flexible. TypeScript is safe. TS is a superset of JS that adds static typing. It catches errors before runtime, not after your app crashes in production. More code upfront = 50% less debugging later. What’s your take? #100DaysOfCode #TypeScript
To view or add a comment, sign in
-
🚀 JavaScript Challenge #1 What will be the output? console.log(1 + "2" + 3); Think before you answer 👇 Most people get this wrong. 👉 JS converts numbers to strings when needed: 1 + "2" → "12" "12" + 3 → "123" ✅ Output: "123" 💡 Lesson: Type coercion can silently change your logic. Did you get it right? 😄 Follow for more daily Challenges
To view or add a comment, sign in
-
I couldn't care less about Claude Code's source being leaked on npm. What terrifies me is that it's 512,000 lines of TypeScript code. HALF A MILLION lines of code for what's essentially a glorified API wrapper. I think the crucial point in our reality when we took the wrong turn was the invention of JavaScript. And we cemented our path to doom with the invention of TypeScript. Half a million lines of code. Dear Lord, have mercy on us.
To view or add a comment, sign in
-
𝗚𝗲𝘁𝘁𝗶𝗻𝗴 𝗦𝘁𝗮𝗿𝘁𝗲𝗱 𝗪𝗶𝘁𝗵 𝗡𝗼𝗱𝗲.𝗷𝘀 𝗜𝗻 𝟮𝟬𝟮𝟱 Node.js is a popular choice for building server-side applications. You can write both frontend and backend code in JavaScript. Here are some benefits of using Node.js: - Fast performance with the V8 JavaScript engine - Large ecosystem with millions of packages on NPM - Great community with active development and support To get started with Node.js: - Download the LTS version from nodejs.org - Verify your installation with node --version Create your first script: - Make a file called hello.js - Add console.log('Hello, Node.js!') - Run it with node hello.js Next steps: - Learn about npm and package management - Explore Express.js for web applications - Study asynchronous programming patterns - Build your first API Source: https://lnkd.in/g8mpJDhG
To view or add a comment, sign in
-
Most API examples stop at a simple fetch() call. But real apps need to handle slow networks, failures, retries, and more. In this guide, Gabor teaches you how to build production-ready networking in JavaScript. https://lnkd.in/gUnseyBd
To view or add a comment, sign in
-
-
🚀 From idea → npm package: introducing socket-lab I built socket-lab, a terminal-first tool to interact with Socket.IO servers locally — connect, join rooms, send events, and inspect responses through an interactive REPL. 📦 npm: https://lnkd.in/ggBKGjar socket-lab helps you: • Connect to any Socket.IO server from the terminal • Join rooms and send messages easily • Inspect and debug live events • Interact through a simple interactive REPL This project was a great exercise in taking a small idea and turning it into a polished developer tool published on npm. 🔗 GitHub: https://lnkd.in/gzhbcXRs Would love feedback from the community and suggestions for improvements! #nodejs #javascript #socketio #npm #cli #react #npm #ReactNative #NestJS #Backend
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