Menu

1 / 4

Running TypeScript Directly in Node.js: A ₹500 Item Came Back as ₹50,090

JavaScript in Plain English - Medium·JavaScript With Vinay·5 days ago
#OwCBO66L
Reading 0:00
15s threshold

Member-only story

Running TypeScript Directly in Node.js: A ₹500 Item Came Back as ₹50,090

JavaScript With Vinay

8 min readNov 3, 2026

Node strips types but never checks them. What it erases, the 4 TS features it rejects, and the check you can’t skip.

I am Vinay Kumar, a Senior Software Developer at Easyres Travel Technology, currently building enterprise ERP and logistics solutions like OpsX (IMS-SAAS).

Here is a tiny HTTP server, written in TypeScript. You give it a price. It hands back that price with 18% GST on top.

I planted one bug. The function asks for a number, and I feed it a string.

No compile. No tsc , no ts-node , no dist . I typed node server.ts and pressed Enter.

The server came up. It replied. The reply was garbage.

import { createServer } from 'node:http';

function addGst(price: number): number {

return price + price * 0.18;

}

createServer((req, res) => {

const url = new URL(req.url ?? '/', 'http://localhost');

const price = url.searchParams.get('price') ??…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.