moment VS lodash

Compare moment vs lodash and see what are their differences.

moment

Parse, validate, manipulate, and display dates in javascript. (by moment)

lodash

A modern JavaScript utility library delivering modularity, performance, & extras. (by lodash)
Our great sponsors
  • Appwrite - The open-source backend cloud platform
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Onboard AI - Learn any GitHub repo in 59 seconds
moment lodash
91 176
47,577 57,936
0.1% 0.6%
0.0 6.7
25 days ago 14 days ago
JavaScript JavaScript
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

moment

Posts with mentions or reviews of moment. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-14.
  • JS Date: The Timezone Tantrum
    3 projects | dev.to | 14 Nov 2023
    We could control the DST flip by setting the test's input time to the appropriate time of year (summer/winter). However we couldn't control the timezone. We had to adjust the expected data in the test 🤢 using the same library which the production code used (momentjs).
  • is there a date calculate script/libary ?
    2 projects | /r/learnjavascript | 11 Jul 2023
  • Top 10 "Must Have" Repositories for Web Developers
    6 projects | dev.to | 11 Jul 2023
    8. Moment.js
  • You don't need zero JS website for a perfect Lighthouse score
    4 projects | dev.to | 9 May 2023
    This may sound a bit general but we can't forget about well-tought code. If we are using a lot of external dependencies, we can check if there aren't many lighter alternatives. Example? Some people are still using moment.js for date formatting. Why not use a lightweight 2kb alternative instead? Writing clean, organized and maintainable code won't give us a huge score boost but we are trying to save every byte of data, right? 😉
  • Everything you need to know about Temporal Date API
    2 projects | dev.to | 18 Feb 2023
    We all know the pain of working with dates in Javascript. It needs to be more explicit, has almost no method, and could not be more clunky. For example, to create the Date January 1, 2023, you have to write a new Date (2023, 0, 1), which can be confusing for beginners, and overall just not that clear. And because of these reasons, the community has made many libraries that attempt to make Date easier to work with over the past years. Like momentjs or Date-fns. But the good news is that you won't need these third-party libraries any longer. The Temporal Date API in Javascript attempts to completely replace the Date object and fix all of the issues we generally face when working with dates.
  • one of my coworkers criticised me for using too shiny libraries.
    3 projects | /r/reactjs | 29 Jan 2023
    moment was put into maintenance mode in 2020 and has gained 7 million weekly downloads to 19 million/week since then.
  • 20 Best Libraries and Tools for React Developers
    11 projects | dev.to | 25 Jan 2023
    Moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. It allows displaying of date as per localization and in a human-readable format.
  • Effortlessly handle dates and times in JavaScript with Luxon
    3 projects | dev.to | 2 Jan 2023
    Luxon is a powerful and lightweight JavaScript library for working with dates and times. It was created as an alternative to the popular Moment.js library, with the goal of being faster, smaller, and easier to use.
  • 18 Best JavaScript Gantt Chart Components
    13 projects | dev.to | 27 Dec 2022
    It allows users to create tasks, change their schedule and duration with drag-and-drop, add dependency lines, and review extra information on tasks via tooltips. You can add multiple timescales to the chart. The list of possible options includes Quarter Day, Half Day, Full Day, Week, and Month. There are also some customization opportunities such as changing the tooltip content with custom HTML, modifying the appearance of task bars and dependency lines, and setting the default timescale. It should be noted that Frappe Gantt has two dependencies: momentjs and snapsvg.
  • Need to calculate time passed between two dates HELP!
    2 projects | /r/learnjavascript | 29 Oct 2022
    https://momentjs.com/ is a useful library for this exact thing.

lodash

Posts with mentions or reviews of lodash. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-24.
  • How to secure JavaScript applications right from the CLI
    8 projects | dev.to | 24 Oct 2023
    To help you quickly set up a project test with the Snyk CLI, a sample JavaScript project has been made available in this GitHub repository with all the necessary manifest files. The project is a simple quote API that uses Lodash and Express as their dependencies. The quote API has a GET / endpoint that returns a list of quotes and a GET /random endpoint that returns a random quote.
  • Lodash just declared issue bankruptcy and closed every issue and open PR
    7 projects | news.ycombinator.com | 16 Sep 2023
    I don't think isEmpty is O(n) except in the case where the object is a prototype[1] - I assume that's one of those weird JS edge cases - otherwise it does what you expect, which is to iterate with a for-in loop and return on the first iteration, so it is O(1).

    [1]: https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L114...

    7 projects | news.ycombinator.com | 16 Sep 2023
    lodash/fp is an optional distribution of lodash that did what the core library did, but did so in a more flexible, powerful, composeable way that makes it easier to construct powerful functions. it was separate from the core, but based heavily on it. https://github.com/lodash/lodash/wiki/FP-Guide

    at the time, nothing was settled. we were in a pioneering mode of building; we didn't know what people would find useful or what the future would hold. there were a lot of different ideas floating around, and lodash was trying to stay the same while also offer a port to this barely-subtly-different paradigm, to see what value might be found there. saying that "introduced" it feels like a crude reduction to me; he allowed people the option they asked for.

    i personally think fp - in particular - "pointsfree" fp - has huge down sides to being understandable. but it also is a much more succinct and capable way of expressing things, and multiple times a week i run into situations where auto-currying or reverse args would make the code i write much cleaner & not damage code comprehension.

    rather than call fp a fad, & insult the author for ever letting it in, i think there's room to say that it's sad that js had to stay on the lowest common denominator. the future was unable to be changed, the old ways stuck. we lost some really good opportunity & capabilities. that said, i still think the pointsfree style is hugely damaging & responsible for greatly reducing the chances we had to improve. instead, we're not "moving on", we're going back to square 1, to the only thing we've ever known or done. that makes me a little sad, to have the pioneering pack up & move back into the city.

    7 projects | news.ycombinator.com | 16 Sep 2023
    The bigger news is that Lodash is migrating from Node.js to Bun: https://github.com/lodash/lodash/commit/97d4a2fe193a66f5f96d...
    7 projects | news.ycombinator.com | 16 Sep 2023
    There’s more discussion in this issue:

    https://github.com/lodash/lodash/issues/5719

    Frankly I commend the author. If you’re maintaining one of the most used open source packages, I think it must be overwhelming to get so much feedback. Realistically a team of 4 people probably working full time could manage a package like that and it seems like it’s just one guys side project.

    7 projects | news.ycombinator.com | 16 Sep 2023
    They tagged 363 issues with "issue bankruptcy" and closed them: https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Acl...

    Same for 325 PRs: https://github.com/lodash/lodash/pulls?q=is%3Apr+is%3Aclosed...

  • Invitation to Contribute: Join the Circle of JavaScript Developers in Building a Repository of One-Line Javascript Codes
    2 projects | /r/learnjavascript | 5 Jul 2023
    Hey! Thanks for sharing. I just want to point out that there are some tried and tested libraries out there that solve some of these problems already. You should check out `lodash`(https://lodash.com/) if you haven't already. Also, there is an array method called `splice` that could improve your implementation of `insert` at first glance.
  • How to kickstart automated test suite when there are 0 tests written and the codebase is already huge
    4 projects | dev.to | 29 Jun 2023
    Alright, now that I’ve got your interest piqued, let’s delve into the real stuff – tangible examples of Pythagora in action. For the purpose of our demonstration, we selected a well-known open source project, Lodash.
  • 20 Essential Parts Of Any Large Scale React App
    15 projects | dev.to | 2 Jun 2023
    lodash : Data manipulation
  • How to slugify a string in JavaScript
    5 projects | dev.to | 21 Apr 2023
    lodash (56k ⭐) — This library provides a wide range of utility functions for JavaScript, including a kebabCase function that can be used to convert a string to kebab case, which is similar to slug format. Kebab case format is a naming convention where words are separated by a hyphen (-) and all letters are in lower case.

What are some alternatives?

When comparing moment and lodash you can also consider the following projects:

dayjs - ⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API

ramda - :ram: Practical functional Javascript

underscore - JavaScript's utility _ belt

date-fns - ⏳ Modern JavaScript date utility library ⌛️

moment-timezone - Timezone support for moment.js

dateformat - A node.js package for Steven Levithan's excellent dateFormat() function.

Luxon - ⏱ A library for working with dates and times in JS

timeago.js - :clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.

RxJS

lazy.js - Like Underscore, but lazier

Sugar - A Javascript library for working with native objects.

immutable-js - Immutable persistent data collections for Javascript which increase efficiency and simplicity.