
























Recently, I surfed the internet and found some strange codes in [here](https://docs.antora.org/antora/latest/install-and-run-quickstart/#install-antora).
```sh node -e "fs.writeFileSync('package.json', '{}')" && npm i -D -E antora ```
It was weird to me. NPM introduce [`npm init`](https://docs.npmjs.com/creating-a-package-json-file), not `node -e` things. So I [committed](https://gitlab.com/antora/antora/-/merge_requests/1136) and wait for responses. But the maintainer rejected my commit and said:
> I'm aware of npm init and we don't recommend it for a good reason. It populates the package.json file with a lot of erroneous keys. It's much cleaner to create the file directly. Just because npm offers init doesn't make it "official". > > [fix `node -e` to `npm init` because it is official](https://gitlab.com/antora/antora/-/merge_requests/1136#note_3453027473)
I didn't understand his speech because the other NPM libraries follow the [`npm init` rules](https://eslint.org/docs/latest/integrate/integration-tutorial) or [create their own `init`s](https://www.prisma.io/docs).
So I'm wondering:
1. Do you tend to follow the rules that suppliers made? 2. If the answer is 'no', why?
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。