Hacker News new | past | comments | ask | show | jobs | submit login

I'm getting real sick of the state of npmjs.org and the lack of ES modules. Or, the lack of documentation on ES modules. So many examples, even for brand new 2022 libraries, show using require() and other gross syntax. It's simply unacceptable in <current year> that require, commonjs, etc are being used.

Take, for example, the yargs module. Somehow, a very popular library. Nowhere in the docs does it show a <working> example of how to import it as an ES module.

Worse still, the typescript typings are all wrong. For example: await yargs.parseAsync() shows as valid TS as the typings indicate that is a function. In reality, you get a runtime error because that function simply does not exist on that object. It's a mess and I cannot wait for Deno to become more popular.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: