How Big Is a String in Bytes in Node?
A string's length and its size in bytes are not the same number, and confusing them breaks anything that counts bytes: upload limits, Content-Length headers, payload budgets. I measured both with a re
A string's length and its size in bytes are not the same number, and confusing them breaks anything that counts bytes: upload limits, Content-Length headers, payload budgets. I measured both with a re
Array.includes is the tool everyone reaches for. Set.has sits one refactor away and is almost never used. I benchmarked both with a real run in Node.js 22, and the gap is not subtle. Full run in this
Retries look like a free win: if a request fails, try again. I tested what they actually cost with a real Node.js run, and the bill is bigger than it looks. Full run in this Short: https://youtu.be/Ck
Splitting a CSV on newline and comma feels obvious. I built exactly that parser, then ran 5 test cases against it. Only 1 passed. Full run in this Short: https://youtu.be/Mp89iYCmfGU What the naive sp
A JWT is three base64 parts, and decoding it is trivial. That convenience creates a dangerous shortcut: if the token decodes, treat it as valid. I tested that belief with a real run, and it failed twi
I ran the same 5,000 SQLite inserts two ways in Node.js and the difference was not small. Full run in this Short: https://youtu.be/-xqnLIvmZTQ The numbers Inserting 5,000 rows one by one took 1,263 ms
Two files, same name, same size. Must be duplicates, right? I tested that assumption with a real Node.js run, and it failed. Full run in this Short: https://youtu.be/nrhOO58008Y The test I made two no
A CSV field is wrapped in quotes to protect it. So what happens when the field itself contains a quote? I tested it with a real run, and the answer is one rule: write two quotes in a row. Full run in
The name says it: comma-separated values. So the parser is one line: split on commas. I tested that belief with a real run, and a single quoted field broke it. Full run in this Short: https://youtu.be