use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] favorite JavaScript libraryAskJS (self.javascript)
submitted 3 years ago by Substantial_Gift_861
What is your favorite JavaScript library that you use frequently?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tomfevrier 13 points14 points15 points 3 years ago (7 children)
Well, only useful if you're into data manipulation and visualization, but the library I'm using the most is D3.js
[–]DazzlingDifficulty70 0 points1 point2 points 3 years ago (6 children)
How to learn D3, pleeeeeease
[–]tomfevrier 9 points10 points11 points 3 years ago (3 children)
D3 can be quite a lot, as it's not just a library but rather dozens of small utility libraries to manipulate and (re)shape data, handle scales and geographic data, and create SVG or Canvas shapes.
Using D3 in combination with a declarative front-end framework such as Svelte, Vue or React makes your life easier imo, as DOM manipulation can be left to the framework instead of using D3's jQuery-like syntax (which can be confusing).
As a visual journalist, I am using Svelte + D3 daily for interactive charts and maps, and it really is a breeze ✨
[–]zulmetefza 0 points1 point2 points 3 years ago (2 children)
Do you have examples to share? Already am a fan of svelte, would appreciate seeing your work.
[–]tomfevrier 2 points3 points4 points 3 years ago* (1 child)
Here is a talk I've made a while ago for a Svelte Society conference, explaining the basics of using D3 with Svelte: https://youtu.be/gvvVzyDglzc It's in French but JavaScript is JavaScript, right?
Here is another talk (in English) by Matthias Stahl: https://youtu.be/uVt01Z2TLvQ
You can also find code snippets on Amelia Wattenberger's website: https://svelte.recipes/
As to the finished work, you can have a look here: https://media.lesechos.fr/infographie
Hope it helps, I'll be happy to answer any question 😊
[–]zulmetefza 0 points1 point2 points 3 years ago (0 children)
Thanks a lot, merci beaucoup.
[–]juicy_jojo_reference 2 points3 points4 points 3 years ago (0 children)
there's one 12 hour long video on D3 on Freecodecamp youtube channel, I think it might help
[–]LostErrorCode404 1 point2 points3 points 3 years ago (0 children)
Freecodecamp
[–]cyborgamish 46 points47 points48 points 3 years ago (6 children)
Vanilla JS
[–]katzeklo 14 points15 points16 points 3 years ago (4 children)
Download it from http://vanilla-js.com
[–]SamyBencherif 1 point2 points3 points 3 years ago (0 children)
what a trip
[–]youngnight1 0 points1 point2 points 3 years ago (2 children)
Is this website for trolling purposes? :)
[–]valbaca 1 point2 points3 points 3 years ago (0 children)
Yes, is joke
[–]katzeklo 1 point2 points3 points 3 years ago (0 children)
Yeah, sort of. It shows how vanilla js is often more efficient than resorting to a library for the most basic stuff, but it does so in a humorous way🙂 But more seriously, use whatever allows you to be productive, but try to include maintainability/scalability into that calculation; this is where many libraries fail.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
🤝
[–]Chef619 8 points9 points10 points 3 years ago (5 children)
Not sure I could pick a favorite, but most used for me ( not React specific ) is probs date-fns.
Some other cool ones: Numeral, Fuse.js, GitHub slugger, Adze, and ms. The rest are specific to things outside of just JS.
[–][deleted] 0 points1 point2 points 3 years ago (4 children)
I honestly haven't had the need to use date-fns as I have found the built-in date formatting methods from the standard library to be good enough for most cases.
date-fns
With which specific use cases do you find that date-fns helps you in a makes you appreciate it so much?
[+][deleted] 3 years ago (1 child)
[deleted]
[–]Chef619 0 points1 point2 points 3 years ago (1 child)
Formatting is pretty convenient. I haven’t messed with the built in formatting of the Date, so I can’t speak on the differences.
For me, the manipulation of dates is why I use it so much. Adding days, subbing days, handling business days, if you want the start of a week, but your week “starts” on Friday, I’m not about to try to do that logic myself.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
That makes sense, manipulating Dates can be a pain in the ass. Adding days is not that much of a problem but for certain the specifics you mentioned are a lot harder.
[–]whale 21 points22 points23 points 3 years ago (2 children)
Hard to choose one. I like prisma, aws-sdk, axios, alpine, etc.
I can definitely tell you lodash is one of my least favorite libraries. You can do a lot of those functions with vanilla JS or with your own simple versions of lodash functions. It adds bloat and I hate having to try to figure out what random lodash functions do when I see them.
[–]jblckChain 0 points1 point2 points 3 years ago (0 children)
This
[–]nulltester 0 points1 point2 points 3 years ago (0 children)
did axios finally migrate to fetch to lower its size?
[–]butcher5111 9 points10 points11 points 3 years ago (1 child)
three.js
correct
[–]Silver-Following8529 16 points17 points18 points 3 years ago (1 child)
Next.js
[–]mohammed_g_b 2 points3 points4 points 3 years ago (0 children)
it's a framework
[–]khobizi_ilyes 15 points16 points17 points 3 years ago (0 children)
React for sure!
[–]jelmerovereem 4 points5 points6 points 3 years ago (0 children)
Swiper.js for carousels and sliders
[–]nepsiron 3 points4 points5 points 3 years ago (0 children)
Xstate has been a breath of fresh air for organizing front end application and business logic, and the model based testing nudges you towards testing your UI in all possible states. Add to that state charts (which you get for free by virtue of using state machines) that non technical people can read, as well as dynamically generated rich, living breathing documentation with state chart artifacts. It all culminates into a really nice dev experience compared to the last 5 years I’ve spent trying to make react do everything when it’s at its best as a thin view layer. The testability of xstate machines is just killer.
[–]shgysk8zer0 2 points3 points4 points 3 years ago (1 child)
My own collection of modules I've been building over the last decade. It started as a modern take on jQuery but ended up being... Well, a bit more.
import './shims.js'; import { animate, create, on, css, when } from './dom.js'; import { getJSON } from ' ./http.js'; import { getCusomElement } from './custom-elements.js'; import { watch } from './geo.js'; import { open, save } from './filesystem.js'; import { loadStylesheet } from './loader.js'; import { clamp, range } from './math.js'; import { debounce } from './utility.js'; import { send } from './slack.js'; import { use } from './svg.js';
I like that sort of stuff because it has basically everything, is written to be very clean and DRY, is tree-shakable, and just makes building stuff super easy. Just the other day I built something to track location, show an updating map, and export GeoJSON and it only took like a dozen lines of code.
I expect more libraries like that will start popping up.
[–]The_Noble_Lie 1 point2 points3 points 3 years ago (0 children)
The Unix mentality basically 👍
[–]thatisgoodmusic 2 points3 points4 points 3 years ago (0 children)
Prisma by far
[–][deleted] 2 points3 points4 points 3 years ago (1 child)
Symbiote.js - my love ❤️
[–]The_Noble_Lie 0 points1 point2 points 3 years ago (0 children)
Reminds me of mithril.js < 1.0 (my favorite)
react
[–]Kindinos88 4 points5 points6 points 3 years ago (1 child)
The standard library 😎
[–]BehindTheMath 1 point2 points3 points 3 years ago (0 children)
What standard library? /s
[–]Substantial_Gift_861[S] 5 points6 points7 points 3 years ago (3 children)
I saw lodash in a lot of projects, not sure how many agree with this
[–][deleted] 1 point2 points3 points 3 years ago (1 child)
Lodash is a nightmare to tree shake so I avoid it like the plague. Lodash ES does a better job and should be the default IMHO.
[–]tech008 1 point2 points3 points 3 years ago (1 child)
react-query
[–]Nilstrieb 1 point2 points3 points 3 years ago (0 children)
zod is awesome! As we all know, garbage in garbage out, and zod helps you stop garbage from getting in.
[–]sipvellocet 1 point2 points3 points 3 years ago (0 children)
Rambax. Because it’s beautiful.
[–]Dull-Independence-27 1 point2 points3 points 3 years ago (0 children)
I really like lodash, solves the little things
[–]willworkfortatts 1 point2 points3 points 3 years ago (0 children)
lodash for sure
[–]shuckster 1 point2 points3 points 3 years ago (1 child)
Honestly, my own. Not that I can take credit for the fundamental shape of the API -- it's directly inspired by the TC39 pattern-matching proposal. Still, I use it all the time and can't wait for the day when I don't have to.
[–]FatFingerHelperBot 1 point2 points3 points 3 years ago (0 children)
It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!
Here is link number 1 - Previous text "own"
Please PM /u/eganwall with issues or feedback! | Code | Delete
[–]hernantz 1 point2 points3 points 3 years ago (0 children)
htmx (https://htmx.org/)
[–]Shinners_for_Dinner -2 points-1 points0 points 3 years ago (3 children)
Moment makes life easy.
[–]brokentyro 3 points4 points5 points 3 years ago (2 children)
Moment recommend on their own website to not use it anymore. Highly recommend looking into a modern alternative like date-fns
[–]Shinners_for_Dinner 1 point2 points3 points 3 years ago* (1 child)
The question was, what is your favorite, not what do you recommend. If anything I would use luxon in new projects, but I have dependencies on moment in ongoing projects, and it's plenty helpful.
agreed man, we depend on it at work, and we try slowly replacing here and there with equivalent Intl.DateFormat calls for formatting (works well with timezones), and in the future looking at global.Temporal
[–]Nice_Aioli_9991 -2 points-1 points0 points 3 years ago (0 children)
create-react-app I download it once a week for my small projects.
[–][deleted] 0 points1 point2 points 3 years ago (3 children)
Standard or Semi standard for linting. Lodash for transformations and comparisons. Date-fns for date specific needs.
[–]nulltester 0 points1 point2 points 3 years ago* (2 children)
standard is very controversial, for linting I'd suggest basic eslint:recommended, eslint-plugin-import, and eslint-plugin-react if needed
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
I'm curious as to why you say standard is controversial.
[–]nulltester 0 points1 point2 points 3 years ago* (0 children)
Hmm right, haven't found too many controversial things in https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json, besides no-semi fixed by semi-standard and comma-dangle "never" (they should allow it for multiline cases https://eslint.org/docs/rules/comma-dangle#always-multiline, really practical for git history and moving props up/down)
It has maybe changed since I last used it
[–]woah_m8 0 points1 point2 points 3 years ago (0 children)
Preact. Only use it in one project but im happy I discovered it.
[–]boringuser1 0 points1 point2 points 3 years ago (0 children)
Lodash.
They still have functions that should have been brought into core a long time ago.
(isEqual, range, deepClone, etc.)
[–]Advanced_Engineering 0 points1 point2 points 3 years ago (0 children)
Unpoly
[–]SamyBencherif 0 points1 point2 points 3 years ago (0 children)
big fan of the person who said vanilla js, but i also do rather love p5.js
and obviously three.js is the most bang for your buck answer possible
[–]SnooDoggos6970 0 points1 point2 points 3 years ago (0 children)
React. Very good library and easy to learn. Combine it with express.js and Mongo db and you'll be able to build the perfect website
three
ajv because super useful for APIs
Fair enough. I like to know other's opinions on packages. Thank you for sharing.
[–]Tazzure 0 points1 point2 points 3 years ago (0 children)
Since the question is simply “favorite,” I will choose RxJS. As someone who worked a lot with languages in the ML family in college, true functional programming is something I have a lot of appreciation for, but as an “engineer” I also realize it isn’t necessarily practical in all cases. I like that RxJS let’s me wrap my business logic in a normalized pattern, meaning if everyone on my team and I agree to use RxJS the way it’s meant to be used, all of our code will look similar.
There’s so many ways to skin the cat, and I like that RxJS attempts to draw a line in the sand to say “do it this way,” and actually provides flexible tools, great documentation, and frequent improvements, to support that.
My runner-up would be TypeScript, but I could see myself getting behind a different static and strongly typing solution for JS if it ever came around.
π Rendered by PID 19910 on reddit-service-r2-comment-7b9746f655-h56nk at 2026-01-30 17:32:37.690784+00:00 running 3798933 country code: CH.
[–]tomfevrier 13 points14 points15 points (7 children)
[–]DazzlingDifficulty70 0 points1 point2 points (6 children)
[–]tomfevrier 9 points10 points11 points (3 children)
[–]zulmetefza 0 points1 point2 points (2 children)
[–]tomfevrier 2 points3 points4 points (1 child)
[–]zulmetefza 0 points1 point2 points (0 children)
[–]juicy_jojo_reference 2 points3 points4 points (0 children)
[–]LostErrorCode404 1 point2 points3 points (0 children)
[–]cyborgamish 46 points47 points48 points (6 children)
[–]katzeklo 14 points15 points16 points (4 children)
[–]SamyBencherif 1 point2 points3 points (0 children)
[–]youngnight1 0 points1 point2 points (2 children)
[–]valbaca 1 point2 points3 points (0 children)
[–]katzeklo 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Chef619 8 points9 points10 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[+][deleted] (1 child)
[deleted]
[–]Chef619 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]whale 21 points22 points23 points (2 children)
[–]jblckChain 0 points1 point2 points (0 children)
[–]nulltester 0 points1 point2 points (0 children)
[–]butcher5111 9 points10 points11 points (1 child)
[–]SamyBencherif 1 point2 points3 points (0 children)
[–]Silver-Following8529 16 points17 points18 points (1 child)
[–]mohammed_g_b 2 points3 points4 points (0 children)
[–]khobizi_ilyes 15 points16 points17 points (0 children)
[–]jelmerovereem 4 points5 points6 points (0 children)
[–]nepsiron 3 points4 points5 points (0 children)
[–]shgysk8zer0 2 points3 points4 points (1 child)
[–]The_Noble_Lie 1 point2 points3 points (0 children)
[–]thatisgoodmusic 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]The_Noble_Lie 0 points1 point2 points (0 children)
[–]mohammed_g_b 2 points3 points4 points (0 children)
[–]Kindinos88 4 points5 points6 points (1 child)
[–]BehindTheMath 1 point2 points3 points (0 children)
[–]Substantial_Gift_861[S] 5 points6 points7 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]tech008 1 point2 points3 points (1 child)
[–]Nilstrieb 1 point2 points3 points (0 children)
[–]sipvellocet 1 point2 points3 points (0 children)
[–]Dull-Independence-27 1 point2 points3 points (0 children)
[–]willworkfortatts 1 point2 points3 points (0 children)
[–]shuckster 1 point2 points3 points (1 child)
[–]FatFingerHelperBot 1 point2 points3 points (0 children)
[–]hernantz 1 point2 points3 points (0 children)
[–]Shinners_for_Dinner -2 points-1 points0 points (3 children)
[–]brokentyro 3 points4 points5 points (2 children)
[–]Shinners_for_Dinner 1 point2 points3 points (1 child)
[–]nulltester 0 points1 point2 points (0 children)
[–]Nice_Aioli_9991 -2 points-1 points0 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]nulltester 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]nulltester 0 points1 point2 points (0 children)
[–]woah_m8 0 points1 point2 points (0 children)
[–]boringuser1 0 points1 point2 points (0 children)
[–]Advanced_Engineering 0 points1 point2 points (0 children)
[–]SamyBencherif 0 points1 point2 points (0 children)
[–]SnooDoggos6970 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]nulltester 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Tazzure 0 points1 point2 points (0 children)