惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
腾讯CDC
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
A
About on SuperTechFans
博客园 - 叶小钗

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker
5 reasons package.json doesn't scale
Ashish Bhatia · 2022-08-14 · via ashishb.net

package.json is the standard package configuration management file used in the Javascript world. To call it terrible is an understatement. Here’s why.

  1. No comments - package.json is a JSON file format. JSON format does not support comments by design. So, there is no way to add either precise comments explaining why something is being done in a certain way or design comments explaining the high-level overview of what’s going on.
  2. No command dependencies - Unlike Makefile, there is no way for a command to depend on another command. So, if you decided to create a release without running the command for creating the build first then that’s your fault.
  3. Variable duplication - package.json supports variables. Except it is convoluted enough that only 15 public packages on GitHub use it. So, hard-coded string literals litter all over the place.
  4. No way to reference other commands properly - Any sufficiently complicated package.json references npm explicitly. And that’s wrong. First, it implicitly assumes that one is using npm, second, it implicitly assumes that the npm one is using is the one that’s in the path. Both of these assumptions start to fail once you have a million users using your library.
  5. Stringification - Like the rest of Javascript, package.json suffers from stringification. While the JSON format supports booleans, integers, strings, arrays, and maps but since no operations are possible, eventually gets stringified.