zkochan / packages

Zoltan Kochan's npm packages
MIT License
99 stars 26 forks source link

refactor(which-pm): simplify yaml loading #201

Open bluwy opened 2 months ago

bluwy commented 2 months ago

Use fs api and js-yaml directly to load yaml file instead of load-yaml-file package. The difference switching to this is:

  1. strip-bom is no longer called. In my tests, having the BOM didn't really affect yaml parsing and it worked fine as before.
  2. Upgraded js-yaml v3 to v4. The migration guide is here. The main difference is that the safeLoad API is renamed to load

NOTE: I also noticed that we could use read-yaml-file from this monorepo, but I feel like using fs + js-yaml directly is simpler.