TE
TechEcho
AccueilTop 24hRécentsMeilleursQuestionsPrésentationsEmplois
GitHubTwitter
Accueil

TechEcho

Une plateforme d'actualités technologiques construite avec Next.js, fournissant des nouvelles et discussions technologiques mondiales.

GitHubTwitter

Accueil

AccueilRécentsMeilleursQuestionsPrésentationsEmplois

Ressources

HackerNews APIHackerNews OriginalNext.js

© 2025 TechEcho. Tous droits réservés.

Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

91 pointspar dhax_oril y a 4 jours
Hey HN!<p>After years of wrestling with Lodash&#x27;s quirks and bundle size issues, I decided to build something better. SuperUtilsPlus is my attempt at creating the utility library I wish existed.<p>What makes it different?<p>TypeScript-first approach: Unlike Lodash&#x27;s retrofitted types, I built this from the ground up with TypeScript. The type inference actually works the way you&#x27;d expect it to.<p>Sensible defaults: Some of Lodash&#x27;s decisions always bugged me. Like isObject([]) returning true - arrays aren&#x27;t objects in my mental model. Or isNumber(NaN) being true when NaN literally stands for &quot;Not a Number&quot;. I fixed these footguns.<p>Modern JavaScript: Built for ES2020+ with proper ESM support. No more weird CommonJS&#x2F;ESM dance. Actually tree-shakable: You can import from specific modules (super-utils&#x2F;array, super-utils&#x2F;object) for optimal bundling. Your users will thank you.<p>The best parts IMO:<p>compactNil() - removes only null&#x2F;undefined, leaves falsy values like 0 and false alone<p>differenceDeep() - array difference with deep equality (surprisingly useful)<p>Better random utilities with randomUUID() and randomString()<p>debounce() that actually works how you expect with proper leading&#x2F;trailing options<p>Also genuinely curious - what are your biggest pain points with utility libraries? Did I miss any must-have functions?

14 comments

7bitil y a 4 jours
&gt; Like isObject([]) returning true - arrays aren&#x27;t objects in my mental model.<p>Correct me if I am wrong, but Array factually are JS objects and &quot;[] instanceof Object&quot; is true.<p>Fair enough if that does not fit your mental model, but I would not use any library that treats facts like opinions.
评论 #44081186 未加载
评论 #44087114 未加载
评论 #44081223 未加载
评论 #44081144 未加载
yoz-yil y a 4 jours
What I’d like is a utility library like this, but instead of it being an actual library, be it some utility that generates a single file with exports of the few functions I need. Even just something that would make copy pasting them easier.<p>As in, I want actual zero dependencies, not even the library itself. The reason: I never want these to randomly update.
评论 #44081573 未加载
评论 #44082145 未加载
评论 #44081675 未加载
评论 #44082501 未加载
评论 #44081979 未加载
_1tanil y a 4 jours
We use es-toolkit to replace Lodash - how would you compare your library?<p>We just migrated a React app with around 500k LOC and this worked quite well and flawless.
评论 #44081949 未加载
dannyfritz07il y a 4 jours
I don&#x27;t think we&#x27;ve really seen many successors to LoDash other than Ramda because the platform now has many of Underscore&#x27;s functions built in.
deadcoder0904il y a environ 14 heures
<a href="https:&#x2F;&#x2F;radashi.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;radashi.js.org&#x2F;</a> is also a good alternative
gaaaaaaaarfil y a 4 jours
Nice work! Reminds me of <a href="https:&#x2F;&#x2F;github.com&#x2F;angus-c&#x2F;just">https:&#x2F;&#x2F;github.com&#x2F;angus-c&#x2F;just</a><p>Suggestion: add more tests and run some benchmarks
评论 #44081934 未加载
评论 #44083639 未加载
meeechil y a 4 jours
don&#x27;t discount the value of a good docs site. that was one of things i loved about lodash that made it so easy to use, and to discover all the functionality it offered. So if you looking to replace it, would be good to have similar docs.
thih9il y a 4 jours
About pain points &#x2F; feature requests:<p>Is there an idiomatic way to duplicate a hash while replacing one of its values, preferably something that supports nesting?<p>Whenever I work with react and immutable structures, this comes up and I hack something simple.<p>I don’t do FE on a regular basis though so my perspective may be skewed.
评论 #44086957 未加载
评论 #44094603 未加载
rco8786il y a 4 jours
I wonder why the authors decided to make `flatten` only go one level deep, and have `flattenDeep` that goes N levels. AFAIK most other implementations of Array.flatten do it recursively through however many levels exist.
insinil y a 4 jours
The published version appears to be CommonJS only:<p><pre><code> $ node index.mjs import { isString } from &#x27;super-utils-plus&#x27; ^^^^^^^^ SyntaxError: Named export &#x27;isString&#x27; not found. The requested module &#x27;super-utils-plus&#x27; is a CommonJS module, which may not support all module.exports as named exports. </code></pre> You might also need to update some of your type checks to handle wrapper objects like new String() - Object.prototype.toString.call(...) is your friend.
评论 #44086287 未加载
jokullil y a 4 jours
I recommend <a href="https:&#x2F;&#x2F;remedajs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;remedajs.com&#x2F;</a> - they&#x27;re always making the types more accurate too. Like groupby has nonempty lists.
评论 #44081900 未加载
评论 #44081916 未加载
redslazeril y a 4 jours
We migrated to remeda from Lodash and are pretty happy. <a href="https:&#x2F;&#x2F;remedajs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;remedajs.com&#x2F;</a><p>What do you do differently?
评论 #44081461 未加载
croneliusil y a 4 jours
I made twitter post 3 or 4 years ago making fun of Lodash team for _still_ not shipping loadash 5 and they didn&#x27;t like it very much. They started working on Lodash 5 in like 2015 and it still hasn&#x27;t shipped. Guess we make our own now
评论 #44081919 未加载
ryancnelsonil y a 4 jours
Biggest pain point: wtf is lodash? I don’t care if it’s in your readme, but maybe tell us in your HN hype post
评论 #44081965 未加载
评论 #44081932 未加载
评论 #44082179 未加载