🚩✊ Friday is Dependency Deletion Day! Today on the chopping block: rimraf (103,000,000 downloads/week). Unless your Node.js version is from the Cretaceous, rimraf delegates to fs.rm under the hood anyway, so you might as well just skip the middleman. Free your node_modules, use fs.rm!

https://nodejs.org/docs/latest/api/fs.html#fspromisesrmpath-options

#javascript #webdev

🚩✊ Friday is Dependency Deletion Day! Today on the chopping block: whatever library you use to encode and decode Base64. Nowadays Uint8Array has built-in toBase64() and fromBase64() methods that support all the flavors you can think of: with or without padding, with or without URL safety… no more need for that crusty old dependency! Free your node_modules, use native Base64 APIs!

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64

🚩✊ Friday is Dependency Deletion Day! Today let's get rid of overly elaborate unit test setups. Node has had a built-in test runner for ages[1], as well as mocking and an assertion library. Want to use TypeScript? Node can do type stripping out of the box[2]. Can't do without a build process? Run it on your test files and pipe the results to node -e.

If you just use what's already there, can delete SO. MANY. DEPENDENCIES!

[1] https://nodejs.org/docs/latest/api/test.html
[2] https://nodejs.org/api/typescript.html

🚩✊ Friday is Dependency Deletion Day! Today your #JavaScript gzip library is up for removal. Compression streams are available on EVERY platform and are easy to use (once you figure out how to turn your data into a stream). Firefox even supports Brotli in compression streams, and I expect other platforms to follow shortly.

#webdev

🚩✊️ Friday is Dependency Deletion Day and reckoning day for lodash's groupBy() function. I have no idea how this still has MILLIONS of weekly downloads when native Object.groupBy() and even Map.groupBy() are available. Free your dependencies by deleting lodash today!
🚩✊️ Friday is Dependency Deletion Day and a good day to consider whether we still need the glob package (212,000,000 downloads/week). After all, Node.js comes with its own glob functions in sync and async flavors. Built-in features always beat clogging up node_modules!

🚩✊️️ TGIF, because Friday is Dependency Deletion Day! It has come to my attention that some folks STILL use lodash because of… cloneDeep?! I see about 150,000,000 weekly downloads for this ancient function on NPM, but come on—we've had structuredClone for some time, and it's better in every way.

👉️ https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone

🚩✊️️️ Friday is Dependency Deletion Day! As TC39 advanced the Temporal API to stage 4 a few days ago, we can finally throw out all legacy #JavaScript date/time handling libraries. Temporal is stable, and polyfills for Safari are readily available. What are you waiting for?

👉️️ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal

#webdev

🚩✊️️️️ Friday is Dependency Deletion Day! You're probably throwing out your date library anyway (now that Temporal is done), but just in case you're wondering about formatting date and time strings, the Intl API has had you covered on this front for years at this point. Uninstall your date library today!

👉 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat

@sir_pepe I like this thread!