This seem quite counter intuitive and to be bloating the project: i’m trying to install tsdoc linter, but npm adds like other 50 packages alongside with it, is this the expected behaviour? Why is it so?

A project that could easily be 5MB ends up being like 60MB

  • stephenc@waveform.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Welcome to JavaScript! This is the expected behavior. For the life of me, it still boggles my mind. I refuse to write JavaScript anymore.

  • corytheboyd@kbin.social
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Packages often have recursive dependencies. There are some conscious packages that go the extra mile to not have any dependencies, but it’s very rare in the JavaScript ecosystem. Welcome to hell. You can at least use dev dependencies to avoid downloading them in CI etc., but that’s about it.

  • MaggiWuerze@feddit.de
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    That’s because the web dev ecosystem at one point decided, that libraries that only offer very minute functionality are acceptable as well as adding 20 of them to your project.

    Examples like isEven or leftPad come to mind, which have such high proliferation, that their dev broke half the planets web projects when he broke them intentionally.

    • The Baldness@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      And this is why I had so much trouble learning JavaScript. It was unclear where the language ended and the libraries & frameworks began.