{
  "id": 6080963,
  "title": "Three things that surprised me shipping a 200-line npm package",
  "url": "https://urgent.news/2026/09/07/three-things-that-surprised-me-shipping-a-200-line-npm-package",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-07T01:14:20.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mengyuxuan/three-things-that-surprised-me-shipping-a-200-line-npm-package-56a9"
  },
  "original_language": "en",
  "account": "Three things surprised the author when shipping a 200-line npm package:\n\n1. npm warned that the bin entry was invalid and removed it, despite the bin script being valid. The warning indicated the path should be written as \"src/cli.js\" instead of \"./src/cli.js\" to avoid the warning. The author confirmed this by running npm's own normalizer, which left both entries alive.\n\n2. The author's tests silently didn't run on two Node versions (Node 18 and 20). The issue was caused by using 'node --test test/*.test.js' in the test script, which prevented the shell from expanding the glob, leading Node to look for a file with an asterisk in its name and exit if none was found. The fix was to use 'node --test' without quotes, so the runner could discover the test directory itself consistently across all Node versions.\n\n3. A registry mirror redirected the author's publish, silently publishing to a host that would never accept the package. The warning displayed a confusing signup page instead of clearly indicating the publication failed. The solution was to set the publishConfig registry in the package.json, so the package would always know which registry to publish to, regardless of the user's configuration or environment.",
  "summary": "I published a small thing last week — video-bitrate-calculator , a zero-dependency library that works out what video bitrate fits under a target file size. About 200 lines of arithmetic. The code was the easy part. Shipping it surfaced three failures that all had the same shape: the tool told me something, the something was misleading, and the correct response was the opposite of the obvious one.…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}