🚀 Day 78 Node.js Fundamentals (Modules, NPM & Packages) Today I learned the core building blocks of Node.js, which are essential before starting serious backend development. 🔹 What is Node.js? • Node.js is a JavaScript runtime environment that allows us to run JavaScript outside the browser, mainly on the server. 🔹 Installing Node.js • After installing Node, we can check if it is working with: node -v npm -v 🔹 Node REPL • REPL stands for Read – Evaluate – Print – Loop. It lets us run JavaScript directly in the terminal. 🔹 Running a Node File • We can create a JavaScript file and run it with Node. app.js console.log("Hello from Node.js"); Run the file: node app.js 🔹 Process in Node • Node provides a process object that gives information about the running program. 🔹 Exporting Modules (File Level) We can export functions from one file and use them in another. math.js function add(a, b) { return a + b; } module.exports = add; app.js const add = require("./math"); console.log(add(2,3)); 🔹 Exporting Modules from a Directory Node automatically reads the index.js file inside a folder. // utils/index.js module.exports = { name: "Utility Module" }; 🔹 NPM (Node Package Manager) NPM allows us to install and manage libraries for our projects. npm init -y 🔹 package.json This file stores important project information such as: • Project name & version • Installed dependencies • Scripts and configurations Example: { "name": "node-project", "version": "1.0.0" } 🔹 Installing Packages • Packages can be installed using NPM: npm install express 🔹 Local vs Global Installation • Local installation (project specific): npm install nodemon • Global installation (available system-wide): npm install -g nodemon 📌 Key Takeaway Today’s learning helped me understand the foundation of Node.js development — REPL, modules, NPM, package management, and running JavaScript on the server. Mastering these basics is the first step toward building scalable backend applications. Continuing my MERN Journey 🚀 #NodeJS #BackendDevelopment #JavaScript #WebDevelopment #LearningInPublic #FullStackJourney
Node.js Fundamentals: Modules, NPM & Packages
More Relevant Posts
-
Built a simple fun project(1) over the past few days that I think other developers might find useful. 𝗥𝗲𝗽𝗼 𝗥𝗼𝘂𝘁𝗲 is a local Git repository visualizer built with Next.js. It renders an interactive, lane-based commit graph directly from your local .git folder, no cloud upload required. The tool runs entirely on localhost and executes raw git commands via Node.js on the server side. I want to test some AI agents with a sample project about capabilities. 𝗪𝗵𝗮𝘁 𝗶𝘁 𝗱𝗼𝗲𝘀, • Renders full branch topology as a horizontal SVG graph, including all branches and remote-tracking refs • Detects and visually distinguishes merge commits (diamond nodes) from standard commits (circle nodes) • Draws dashed flow lines from source branches into merge points • Parses Pull Request metadata directly from Git commit messages (e.g., "Merge pull request #X from user/branch") without any GitHub API dependency for local mode • Dynamically reconstructs visual lanes for branches that were merged and subsequently deleted • Displays repository statistics: unique authors, merge rate, PR count, activity span, top contributor, and date range • Horizontal zoom controls for navigating dense commit graphs 𝗧𝗲𝗰𝗵 𝘀𝘁𝗮𝗰𝗸 Next.js 14 (App Router), TypeScript, Tailwind CSS, Node.js child_process for git execution, SVG for graph rendering 𝗧𝗿𝘆 𝗶𝘁 𝘆𝗼𝘂𝗿𝘀𝗲𝗹𝗳 git clone https://lnkd.in/gP8Tu6ZR cd RepoRoute npm install 𝗦𝗲𝘁𝘂𝗽 𝗲𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁 𝘃𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 Create a file called .env.local in the project root: NEXT_PUBLIC_GITHUB_TOKEN=your_github_token_here 𝗛𝗼𝘄 𝘁𝗼 𝗴𝗲𝘁 𝗮 𝗚𝗶𝘁𝗛𝘂𝗯 𝗣𝗲𝗿𝘀𝗼𝗻𝗮𝗹 𝗔𝗰𝗰𝗲𝘀𝘀 𝗧𝗼𝗸𝗲𝗻 1. Go to GitHub -> Settings -> Developer Settings -> Personal Access Tokens -> Tokens (classic) 2. Click "Generate new token (classic)" 3. Give it a name, set expiration, and select the repo scope (read-only is enough) 4. Copy the generated token and paste it into .𝗲𝗻𝘃.𝗹𝗼𝗰𝗮𝗹 as shown above Note: The token is only required for analyzing public GitHub repositories via the GitHub API. For local folder analysis, no token is needed. 𝗥𝘂𝗻 𝘁𝗵𝗲 𝗱𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁 𝘀𝗲𝗿𝘃𝗲𝗿npm run dev Open http://localhost:3000 in your browser. 𝗧𝗼 𝗮𝗻𝗮𝗹𝘆𝘇𝗲 𝗮 𝗹𝗼𝗰𝗮𝗹 𝗿𝗲𝗽𝗼𝘀𝗶𝘁𝗼𝗿𝘆 1. Toggle the mode to "Local Folder" in the search bar 2. Paste the absolute path to any Git repository on your machine (e.g., C:\Users\you\Projects\my-app) 3. Click Visualize This is purely a personal engineering exercise. The goal was to build something that visualizes Git history in a way that is actually useful for understanding branch topology, without relying on GitHub's web interface or third-party paid tools. Feedback or contributions are welcome. #dushaDev#funProject #OpenSource #Git #NextJS #TypeScript #DeveloperTools #WebDevelopment
To view or add a comment, sign in
-
-
Making projects is fun. But setting up the same folder structures, files, and boilerplate every single time before writing any real code… not so fun. Every developer knows the drill. You start a project and before you even begin coding, you're stuck creating folders, files, and scaffolding for the next 10-15 minutes. And as a soon-to-be engineer, I’ve realized something: Whenever I see a repetitive problem, my first instinct is always - can this be automated? So I built VibeFiles⚡- a free VS Code extension that generates project folder structures and files instantly. Instead of manually creating everything, you can now: 🗂️ Generate full project structures using templates Choose frameworks like *React, Next.js, Express, Node.js, Flask, or Django*, pick your language, and VibeFiles creates the entire structure with starter files in seconds. 📸 Create folder structures directly from images Have a screenshot of a GitHub repo structure? A VS Code explorer view? Even a hand-drawn architecture diagram? Upload it, and VibeFiles detects the structure and creates the files automatically. 📋 Generate structures directly from Text Already have your folder structure written somewhere? Just paste it into Text Mode, and VibeFiles will instantly convert it into real folders and files. Or even tree-style formats copied from terminals or GitHub (├── └──). VibeFiles reads the structure, previews it for verification, and creates the entire file system in seconds. No manual clicking. No repetitive setup. Just paste → preview → generate. No accounts. No setup. Just install and generate. My goal with this was simple: Developers should spend their time building ideas, not creating empty folders. Small problem. Simple solution. Hopefully useful for a lot of developers , like me !! If you’d like to try it out: 1️⃣ Open VS Code 2️⃣ Go to the Extensions tab 3️⃣ Search for “VibeFiles” and install it 4️⃣ Once installed, you’ll see the VibeFiles icon in the sidebar alongside your other extensions - click it to start generating your project structures instantly. You can also install it directly from the VS Code Marketplace: https://lnkd.in/gX8u6Dy8 Checkout the github repo link - https://lnkd.in/g7-fiWhW If you try it out, I’d love to hear what you think 🚀 #BuildInPublic #DeveloperTools #VSCode #Automation #DevTools #VibeCoding
To view or add a comment, sign in
-
🚀 Building scalable REST APIs? NestJS is worth your attention NestJS is a progressive Node.js framework that brings structure, scalability, and TypeScript-first development to your backend — inspired by Angular’s architecture. Here’s how clean a NestJS controller looks: // users.controller.ts @Controller('users') export class UsersController { constructor(private readonly usersService: UsersService) {} @Get() findAll() { return this.usersService.findAll(); } @Post() create(@Body() createUserDto: CreateUserDto) { return this.usersService.create(createUserDto); } } Why NestJS stands out for API development: ✅ Modular architecture — Controllers, Providers, Modules ✅ Built-in Guards, Pipes, Interceptors & Middleware ✅ First-class TypeScript support ✅ Works with TypeORM, Prisma, Mongoose out of the box ✅ GraphQL, WebSockets & Microservices support built-in ✅ OpenAPI/Swagger integration with zero hassle Official docs to bookmark: 📖 Getting Started → https://lnkd.in/gKB5w_Em 📖 Controllers → https://lnkd.in/gzuGx3_N 📖 Authentication → https://lnkd.in/gWSRusng 📖 Database → https://lnkd.in/gSgyh9Hy If you’re building serious backend APIs with Node.js, NestJS gives you the structure that Express never could. What backend framework are you currently using? 👇 #NestJS #NodeJS #TypeScript #BackendDevelopment #API #WebDevelopment
To view or add a comment, sign in
-
Angular is a modern, TypeScript-based framework developed by Google for building dynamic, scalable single-page applications (SPAs). To get started, you’ll need Node.js, Angular CLI, and a basic understanding of HTML, CSS, and JavaScript. 🔑 Key Angular Concepts Component-Based Architecture: Applications are built using reusable components that manage their own logic, templates, and styles. Two-Way Data Binding: Synchronizes data between the model (TypeScript code) and the view (HTML template). Dependency Injection (DI): Provides services and resources efficiently across components. Routing: Enables navigation between different views without reloading the page. Directives: Special markers in templates that extend HTML (e.g., *ngIf, *ngFor). Services: Classes that handle business logic and data, often injected into components. Modules: Group related components, directives, and services together for better organization. ⚙️ Setting Up Angular Install Node.js & npm Download from nodejs.org. Verify installation: bash node -v npm -v Install Angular CLI bash npm install -g @angular/cli Create a New Project bash ng new my-app cd my-app ng serve Open http://localhost:4200 in your browser. 📂 Basic Project Structure src/app/app.component.ts → Main component logic src/app/app.component.html → Template (UI) src/app/app.component.css → Styles app.module.ts → Root module that declares components and imports Angular features 🖥️ Example: Hello World Component typescript import { Component } from '@angular/core'; @Component({ selector: 'app-hello', template: `<h1>Hello Angular!</h1>`, styles: [`h1 { color: blue; }`] }) export class HelloComponent {} Add <app-hello></app-hello> in app.component.html to render it. ⚠️ Common Pitfalls Skipping TypeScript basics → Angular heavily relies on TypeScript. Not modularizing code → Leads to messy projects. Ignoring RxJS → Reactive programming is central to Angular’s data handling. ##Angular
To view or add a comment, sign in
-
Project 1 – 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 + 𝗥𝗲𝗮𝗰𝘁 𝗔𝗽𝗽 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 𝘄𝗶𝘁𝗵 𝗗𝗼𝗰𝗸𝗲𝗿𝗳𝗶𝗹𝗲 & 𝗖𝗼𝗼𝗹𝗶𝗳𝘆 📅 #150days150thingsinlaravel Building applications is one thing… Deploying them to production is where real learning begins 🔥 Today, I completed my first end-to-end full-stack deployment project using Laravel, React, Docker, and Coolify 💡 🧱 What I Covered in This Project 👇 🔹 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 + 𝗥𝗲𝗮𝗰𝘁 (𝗜𝗻𝗲𝗿𝘁𝗶𝗮) 𝗦𝗲𝘁𝘂𝗽 ✅ Installed Laravel project using modern setup ✅ Integrated Breeze with React + Inertia ✅ Built authentication system (Login / Register) ✅ Configured Tailwind CSS + Vite 🌐 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗜𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻 (𝗦𝘂𝗽𝗮𝗯𝗮𝘀𝗲) ✅ Connected Laravel with PostgreSQL (Supabase) ✅ Managed environment variables securely ✅ Ran migrations on cloud database 📁 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 ✅ React inside resources/js (Pages, Components, Layouts) ✅ Laravel handles backend logic & routing ✅ Inertia connects backend → frontend seamlessly ⚙️ 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 ✅ Optimized Composer dependencies ✅ Built frontend assets (npm run build) ✅ Configured .env for production 🐳 𝗗𝗼𝗰𝗸𝗲𝗿 𝗜𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻 ✅ Created custom Dockerfile (PHP + Apache + Node) ✅ Used .dockerignore for clean builds ✅ Built Docker image locally ✅ Ran container successfully ☁️ 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 𝘂𝘀𝗶𝗻𝗴 𝗖𝗼𝗼𝗹𝗶𝗳𝘆 (𝗛𝗼𝘀𝘁𝗶𝗻𝗴𝗲𝗿 𝗩𝗣𝗦) ✅ Installed Coolify on VPS ✅ Connected GitHub repository ✅ Configured Docker-based deployment ✅ Added environment variables securely ✅ Enabled domain & SSL 🚀 𝗙𝗶𝗻𝗮𝗹 𝗢𝘂𝘁𝗰𝗼𝗺𝗲 🌐 Live Laravel + React application 🔐 Authentication working ⚡ Fully deployed using Docker + Coolify ⚠️ 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀 & 𝗙𝗶𝘅𝗲𝘀 ❌ Assets not loading → Fixed with npm run build ❌ Permission issues → Fixed storage permissions ❌ Container restarting → Debugged using logs ❌ Bad Gateway → Fixed port configuration 💡 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆𝘀 ✔ Deployment is a must-have skill for developers ✔ Docker removes “it works on my machine” problems ✔ Coolify simplifies VPS deployments ✔ Inertia.js makes Laravel + React integration smooth 🔥 From learning concepts → to building → to deploying This is where real growth happens 🚀 👉 Follow my journey: #150days150thingsinlaravel 🔖 Hashtags #Laravel #ReactJS #InertiaJS #Docker #Coolify #Supabase #PHP #FullStackDevelopment #WebDevelopment #BackendDevelopment #DevOps #SoftwareDevelopment #CodingJourney #DeveloperJourney #DailyLearning #LearningInPublic #BuildInPublic #Programming #CleanCode #DeveloperTips #TechCommunity #CareerGrowth #Consistency #LinkedInTech #LinkedInLearning
To view or add a comment, sign in
-
Shipped a big update for starter-structure-cli today: v0.3.0 This project started as a way to stop wasting hours on the same setup work before real development even begins. Since sharing it, starter-structure-cli has reached 515 npm downloads across the last two weeks: • 480 downloads between March 3, 2026 and March 9, 2026 • 35 more downloads in the following week Still early, but for a tool I’m building step by step, this feels like a meaningful milestone. The idea behind starter-structure-cli is simple: instead of repeatedly setting up the same boilerplate, you can scaffold a production-ready starter project from simple stack tokens like: #npx starter-structure-cli my-app react vite ts tailwind express prisma postgres With v0.3.0, the CLI now supports 36 production-ready starter templates. What’s new in v0.3.0 • Added new backend, single-app, and fullstack starters • Added Fastify + Prisma + Postgres starter • Added Next.js + TypeScript + shadcn/ui + Tailwind starter • Added React/Vite and Vue/Vite fullstack starters with Prisma + Postgres • Refactored the CLI into smaller modular helpers for easier maintenance • Strengthened template validation and release checks • Added better docs for template authoring and catalog discovery What I’m trying to build • a faster way to start real projects • a cleaner learning path for beginners • a more consistent project baseline for teams and freelancers Tech included across the catalog React, Next.js, Vue, Vite, Tailwind CSS, shadcn/ui, Express, NestJS, Prisma, Mongoose, Sequelize, MongoDB, MySQL, PostgreSQL, JWT, and NextAuth It currently supports multiple project types including: • Single App • Frontend • Backend • Fullstack • Monorepo • Turbo Monorepo What I like most about building this is that it can help different kinds of developers: • Beginners who want a proper structure from day one and want to learn by working with real code • Experienced developers who want to skip repetitive setup and start faster • Teams, freelancers, and leads who want a more consistent foundation across projects Would genuinely love feedback on: • which stacks I should add next • what project structure you expect from a serious starter • what would make a CLI like this genuinely useful in your workflow GitHub: https://lnkd.in/gv3jj-kX npm: https://lnkd.in/gZfmaHxG #nodejs #javascript #cli #opensource #webdevelopment #fullstack #react #nextjs #vue #tailwindcss #express #prisma #npm #developertools
To view or add a comment, sign in
-
-
🚀 Day 15– TypeScript: What, Why & How (With Real-Time Thinking) Today I went deeper into understanding TypeScript — not just as a language, but as a practical tool used in real projects. 🔹 What is TypeScript? TypeScript is a superset of JavaScript developed by Microsoft that adds static typing. 👉 But in real development, it acts like a safety layer on top of JavaScript that helps prevent mistakes before the code even runs. 🔹 Why TypeScript is Important (Real Problems I Noticed) While working on applications, these are very common issues: ❌ API response structure is unclear ❌ Accessing undefined properties causes runtime errors ❌ Large code becomes hard to understand for new developers ❌ Small changes break existing functionality 👉 TypeScript helps solve these problems by: ✔️ Enforcing strict types for data ✔️ Catching errors during development ✔️ Making code self-documenting ✔️ Improving maintainability in large-scale applications 🔹 Basic Data Types (Foundation) let name: string = "Keerthi"; let age: number = 25; let isActive: boolean = true; let skills: string[] = ["Java", "TypeScript"]; let user: [string, number] = ["Keerthi", 25]; // tuple 👉 These types make the code more predictable and avoid mistakes. 🔹 Real Problem: Unclear API Response const user = getUser(); console.log(user.name); // ❌ risky ✔️ With TypeScript: interface User { name: string; age: number; } const user: User = getUser(); 🔹 Function Safety function add(a: number, b: number): number { return a + b; } // add(10, "20") ❌ Error 🔹 UI State Handling type Status = "loading" | "success" | "error"; let status: Status = "loading"; 👉 Prevents invalid values 🔹 Real-Time Scenarios Where I Can Use TypeScript 📌 API Integration Defining interfaces ensures I know exactly what fields are coming from backend. 📌 Form Handling Optional properties help when some fields are not mandatory. 📌 UI State Management Using fixed types for states like "loading" | "success" | "error" avoids invalid states. 📌 Function Design Clearly defining input and return types avoids misuse of functions. 📌 Team Collaboration Other developers can understand the structure without extra documentation. 🔹 How TypeScript Works TypeScript (.ts) → Compiled using tsc → JavaScript (.js) → Runs in browser/node 👉 Important point: Browsers understand only JavaScript, not TypeScript. 🔹 Small Example Without TypeScript: We might accidentally pass wrong data and only find issues at runtime. With TypeScript: We get immediate errors during development, which saves debugging time. 🔹 My Key Learning TypeScript is not just about adding types — it’s about writing code that is: ✔️ Safer ✔️ Easier to understand ✔️ Easier to maintain ✔️ More reliable in real-world applications #TypeScript #JavaScript #FrontendDevelopment #InterviewPreparation #LearningJourney #SoftwareDevelopment
To view or add a comment, sign in
-
Understanding Node.js goes well beyond knowing how to write JavaScript on the server. The real value comes from understanding why it works the way it does. The third article in a five-part series on RESTful APIs covers the internals that make Node.js a strong choice for building APIs and server-side applications. The Event Loop architecture and how it enables asynchronous, non-blocking operations on a single thread. The progression from callbacks to promises to async/await, and how each layer of abstraction connects back to the same underlying queue system. NPM and package management best practices. Buffers and streams for efficient data processing. And the Node.js I/O API that gives JavaScript access to operating system resources that browsers deliberately restrict. For developers building with Node.js or evaluating it for a project, this is the kind of depth that separates confident usage from guesswork. Read the full article: https://lnkd.in/dEs4UFRx #WebDevelopment #NodeJS #JavaScript
To view or add a comment, sign in
-
THIS! 💯 I’ve been sounding the alarm on this architectural trend for over half a decade, but it seems like a lot of newer developers have just accepted it as the gold standard because they simply haven't experienced anything else. Look, I understand the primary selling point. The “no context switching” argument is entirely valid. Jumping between a robust, dedicated backend language and frontend JavaScript can be mental whiplash, and the dream of a unified, single-language stack is appealing. I've been there and felt that pain. But that convenience comes at an incredibly high cost. We've force-fed a language into an environment it was never built to operate in. Here is the reality of the Node.js ecosystem: • It’s fundamentally the wrong tool for the job: Let's not forget history. JavaScript was designed in a matter of days as a lightweight scripting language to manipulate the DOM and make browsers interactive. It was never architected for heavy-lifting, concurrent server-side processing, or enterprise-grade backend stability. We are pounding a square peg into a round hole and calling it "modern." • A Fractured Ecosystem & Dependency Hell: The Node environment is famously disjointed. Instead of robust standard libraries, you are forced to rely on a gazillion third-party dependencies, which themselves rely on a gazillion sub-dependencies. It's a fragile house of cards where executing a simple task requires downloading half the internet into a bloated `node_modules` black hole. • An Ongoing Security Nightmare: Because of this sprawling, infinitely nested dependency tree, NPM has become a playground for bad actors. It feels like the registry is compromised, or a popular package falls victim to a supply-chain attack, every other day. You aren't just deploying your code; you are blindly trusting thousands of unknown, unvetted third-party authors with your server's security. Backend architecture used to be about robust, battle-tested stability. Now, it's about hoping your latest `npm install` doesn't secretly pull in a crypto-miner or break your entire build. We traded solid engineering for the convenience of not having to learn a second syntax.
System Architect & Philosopher | Sustainable System Design • Technical beauty emerges from reduction • Root-cause elimination • Wabi-Sabi 侘寂
✮✮✮ THE INVOICE ✮✮✮ JavaScript Backend: The Full-Stack Tax "One language for frontend and backend! Share code! One team! No context-switching!" Splendid. Let us examine what you are actually paying for. In 1995, Brendan Eich built JavaScript in ten days. For form validation and image rollovers. Thirty years later, it runs production backends. The language has not changed. The expectations have. ✮ The Resource Invoice Express: 20,000 requests per second. Go: 40,000. Rust: 60,000. On Lambda, Node.js averages 20ms. Rust: 1.12ms. Eighteen times faster for the same work. The real cost is memory. Express idles at 30-50 MB. Go: 5-10 MB. Rust: 1-2 MB. V8's garbage collector runs whether you need it or not. When it pauses, your latency spikes. You are paying for the runtime, not your application. ✮ The Architecture Invoice One thread. That is your entire backend. Like a server in 1983. Every CPU-intensive operation blocks every other request. The fix is not fixing the runtime. The fix is containerisation. Cannot use multiple cores? Spin up multiple containers. Cannot manage containers? Add Kubernetes. The entire cloud-native stack exists, in part, to compensate for a language that does not know what to do with your lovely CPU cores. Go uses all cores by default. Rust uses all cores by default. Node.js uses one, then asks for an orchestration platform. One does wonder how we ended up here. ✮ The Type Safety Invoice JavaScript has no types. The fix: TypeScript, a transpilation layer that adds a mandatory build step to a language designed to run directly. Type checking consumes 95% of compilation time. Large codebases: three minutes per compile. The workaround: bypass tsc with swc and lose type checking at build time. You have added a type system, then disabled it for performance. Marvellous. ✮ The Security Invoice In 2024, 500,000 malicious npm packages: 98.5% of all malware across every language ecosystem. In September 2025, eighteen packages with 2.6 billion weekly downloads compromised in one attack. debug. chalk. In your tree right now. The insecurity is not merely npm. Node.js loads third-party code at runtime with full system access. Go compiles dependencies once. Rust links statically. The attack surface is different by design. ✮ The Alternative For I/O-bound real-time workloads, Node.js is genuinely competent. That is what it was designed for. For everything else: Rust gives you a single binary with no GC, native concurrency, and static linking at 1-2 MB. Go gets you halfway there, though Google's garbage collector still takes its cut. Neither needs a transpilation step or a package manager at runtime. ✮ The Pattern Brendan Eich built JavaScript to validate forms. Ryan Dahl put it on the server, then called node_modules "an irreparable mistake" and built Deno to fix it. The language's own architect moved on. One does wonder whether the ecosystem noticed. #TheInvoice #JavaScript #NodeJS #Backend #WebDev
To view or add a comment, sign in
-
-
I once spent a lot of energy trying to fix a Node.js + Express backend, after not being able to convince the customer to move elsewhere, at least for some core services. The customer knew nothing about software development and they previously hired an infrastructure engineer with no solid development experience who convinced them that JavaScript on the server was a good idea. 😭 The codebase was a mixture of badly written, untyped JavaScript and some decent TypeScript, signal that the previous development team had no coordination: every developer was randomly putting his/her personal style into the code. Not to mention, the backend was impossible to debug because it did not contain a single log statement "because logging consumes resources" 🤦♂️ Some part of the code was meant to perform massive monetary calculations with very high precision and they were using plain floating point. Using floating-point numbers for money is dangerous, requires specialized libraries for that. Even if you fix precision, Node may still struggle with extreme throughput + heavy CPU math. But nobody of them was aware of the issue and they wondered why numbers in the general ledger did not add up. Of course, they where accumulating massive rounding errors. Needless to say, the system was very slow under concurrent load. Below a quite comprehensive list of reasons why JavaScript on the backend is a popular but often wrong idea.
System Architect & Philosopher | Sustainable System Design • Technical beauty emerges from reduction • Root-cause elimination • Wabi-Sabi 侘寂
✮✮✮ THE INVOICE ✮✮✮ JavaScript Backend: The Full-Stack Tax "One language for frontend and backend! Share code! One team! No context-switching!" Splendid. Let us examine what you are actually paying for. In 1995, Brendan Eich built JavaScript in ten days. For form validation and image rollovers. Thirty years later, it runs production backends. The language has not changed. The expectations have. ✮ The Resource Invoice Express: 20,000 requests per second. Go: 40,000. Rust: 60,000. On Lambda, Node.js averages 20ms. Rust: 1.12ms. Eighteen times faster for the same work. The real cost is memory. Express idles at 30-50 MB. Go: 5-10 MB. Rust: 1-2 MB. V8's garbage collector runs whether you need it or not. When it pauses, your latency spikes. You are paying for the runtime, not your application. ✮ The Architecture Invoice One thread. That is your entire backend. Like a server in 1983. Every CPU-intensive operation blocks every other request. The fix is not fixing the runtime. The fix is containerisation. Cannot use multiple cores? Spin up multiple containers. Cannot manage containers? Add Kubernetes. The entire cloud-native stack exists, in part, to compensate for a language that does not know what to do with your lovely CPU cores. Go uses all cores by default. Rust uses all cores by default. Node.js uses one, then asks for an orchestration platform. One does wonder how we ended up here. ✮ The Type Safety Invoice JavaScript has no types. The fix: TypeScript, a transpilation layer that adds a mandatory build step to a language designed to run directly. Type checking consumes 95% of compilation time. Large codebases: three minutes per compile. The workaround: bypass tsc with swc and lose type checking at build time. You have added a type system, then disabled it for performance. Marvellous. ✮ The Security Invoice In 2024, 500,000 malicious npm packages: 98.5% of all malware across every language ecosystem. In September 2025, eighteen packages with 2.6 billion weekly downloads compromised in one attack. debug. chalk. In your tree right now. The insecurity is not merely npm. Node.js loads third-party code at runtime with full system access. Go compiles dependencies once. Rust links statically. The attack surface is different by design. ✮ The Alternative For I/O-bound real-time workloads, Node.js is genuinely competent. That is what it was designed for. For everything else: Rust gives you a single binary with no GC, native concurrency, and static linking at 1-2 MB. Go gets you halfway there, though Google's garbage collector still takes its cut. Neither needs a transpilation step or a package manager at runtime. ✮ The Pattern Brendan Eich built JavaScript to validate forms. Ryan Dahl put it on the server, then called node_modules "an irreparable mistake" and built Deno to fix it. The language's own architect moved on. One does wonder whether the ecosystem noticed. #TheInvoice #JavaScript #NodeJS #Backend #WebDev
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