All your packages are belong to us.

On npm, HTTP, and CJK.

Aug 15, 2021

A doodle of Smaug from The Hobbit with the word hoard in Chinese, Malay, and English on the left.

This marks a month since my first weekly post in July. It’s the end of week 32 of 2021 and 20 more weeks till end of the year, there should be 25 posts this year, if I managed to keep this up. Does collecting weekly posts count as hoarding? Like how we can hoard packages with npm Workspaces or improve webpage performance by letting browsers hoard caches.

  • Node.js & npm: Workspaces is supported in npm v7, which ships with Node.js v15 and v16. It uses the workspaces field in package.json just like yarn. That’s one more reason to look forward to Node.js v16 being LTS other than it ships with binaries prebuilt for Apple Silicone. Do note that npm v7 will convert existing package-lock.json to a new format.

  • Browser & HTTP: the Cache-Control header in a HTTP request might be affected by browser settings, e.g. a browser might send Cache-Control: no-cache or even Pragma: no-cache when caching is disabled, which instructs intermediaries to not use a stored response without successful validation on the origin server.

  • Encoding & languages: Chinese, Japanese, and Korean characters are commonly referred to as CJK when it comes to character encoding. There are quite a number of blocks in Unicode for CJK but a Unicode character alone does not indicate which of the languages is in use, much like the character “A” does not indicate whether English or Malay is in used.

Thank you for reading and do let me know your thoughts about this post. If you want more content like this to be delivered to you, consider subscribing via Substack: smallpotatodev.substack.com