Dum: An NPM scripts runner written in Rust

  • I'm just dumbfounded that HN guys became so negative! Literally every comment is so negative :( Please guys, this guy did an awesome job, the painful slowness of npm -- I gotta endure it everyday, this guy is literally giving me a sigh of relief. I'm gonna use it over npm and even contribute if necessary.

    If "written in Rust" is a clickbait, then most first page HN titles are clickbaity too otherwise why will you click on them? To me and most people, "Written in Rust" or even "Written in Go" reads like "it's fast" and that's definitely a feature!

  • I'm not sure why all the shade for this project.

    NPM is painfully slow, everyone's harping on the 200ms, for larger projects that number is much higher.

    I'll be using this and happy it exists.

  • > Instead of waiting 200ms for your npm client to start, it will start immediately.

    That seems like a pretty big performance problem on Node's part.

    Wouldn't it be better if Node solved this, than people having to use external package managers that may not be so well-integrated into the ecosystem? Thirdly would people even bother using an external package manager because of a 200ms delay? Is that considered acceptable at this point?

  • Honest question, what use case have people run into with non scripts that a 300ms startup time is painful for? Mine have always been simple and run not very often, so it’s barely mattered to me, but I’m sure I’m missing some obvious uses that others have

  • You could make this actually useful by making it read a .env file to set the environment, instead of what people always do, which is:

    > "test": "NODE_ENV=test mocha --reporter spec"

    (and doesn't work across platforms like windows)

    Or added functionality like being able to pipe the output to multiple places (eg. terminal and log file).

    That would offer perhaps a slightly more compelling use-case than saving 200ms; I don't care about that much, I honestly doubt anyone else does either.

    The spawn time for an npm compared to the runtime for an npm task are orders of magnitude different, surely, for any non trivial task.

  • My first thought seeing this was “I wonder if they know about bun”, was happy to see it’s an inspiration! And just in general happy to see more performance-focused tooling projects in the ecosystem. Good stuff.

  • Rust based tools are so cool. I have used various cli tools and they are just awesome. One example is fnm which is fast and makes it easy to switch node js versions.

  • Seems cool, but I have never felt that the 200ms wait is any way an issue for me. Also just a funny note but Dum means stupid in Swedish. :D

  • Glad to never have really used scripts in package.json, just bash scripts directly calling `./node_modules/.bin/whatever`

  • i've been loving egoist/dum as a complement to antfu/ni, but god forbid i ever remember how to update a cargo package. egoist if you're here, have you considered publishing binaries to npm?

  • Another project by Egoist.

    This is one of those people who just constantly pump out so much open source code. I remember looking through their profile when I was using EME years ago (2017?), wishing I had the time to do half of what they were tackling.

  • Slightly off topic: So many projects and posts boast “written in Rust”. I haven’t been on HN that long—was there a point in time where “written in C++” was a similar “selling point”?

    From a quick glance, it looks like this could have been implemented in any native language. I like Rust as much as the next guy, but using it to get clicks when Rust specifically over another native language doesn’t make a difference feels a bit clickbaity.

  • undefined

  • you don't need NPM to run bash scripts, or js scripts

    it doesn't matter that you have the thing re-written in Rust, because there is no reason for such thing to exist in the first place.