dayjs VS lodash

Compare dayjs vs lodash and see what are their differences.

dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API (by iamkun)

lodash

A modern JavaScript utility library delivering modularity, performance, & extras. (by lodash)
Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
dayjs lodash
97 187
45,661 58,812
- 0.4%
7.4 5.2
12 days ago 7 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.

dayjs

Posts with mentions or reviews of dayjs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-12.
  • The Day.js Dilemma: How Should We Handle OSS Maintainers Going MIA?
    2 projects | news.ycombinator.com | 12 Apr 2024
    As web developers, we heavily rely OSS packages. One popular example is Day.js, a JS lib for parsing, validating, manipulating, and formatting dates. It's a widely-used alternative to Moment, with over 17mil weekly downloads on npm.

    A critical bug was discovered in Day.js (see: https://github.com/iamkun/dayjs/pull/2118) causing incorrect date manipulation (add, subtract) when in UTC TZ. This could have severe implications for any project relying on Day.js for date-related functionality. However, the maintainer of the project appears to be unresponsive, leaving the bug unresolved and the future of the library uncertain.

    This raises some important questions for our community:

    - At what point should we consider a widely-used OSS project "abandoned" if the maintainer is unresponsive?

    - Is forking the project the best solution, or should we first try to reach out to the maintainer through other channels?

    - Are there established community guidelines around responsiveness expectations for widely-used OSS projects?

    - What are successful examples of community-driven forks or maintenance after a maintainer stepped away?

    I am very aware that many of these developers give their spare time for free for these projects, with little or no payment, and I am very thankful for all their work. This developer does get some money (a small amount?) through OpenCollective, and possibly also works for a company (in China?) that makes a UI library, which I think uses Day.js internally.

    2 projects | news.ycombinator.com | 12 Apr 2024
  • JavaScript Libraries That You Should Know
    8 projects | dev.to | 19 Mar 2024
    11. DayJs
  • Best date library to handle timezones in React Native?
    3 projects | /r/reactnative | 5 Dec 2023
    DayJS has issues with its timezone plugin not compatible with Hermes engine https://github.com/iamkun/dayjs/issues/1942
  • Everything you need to know about Date in Programming
    2 projects | dev.to | 28 Oct 2023
    Date.js
  • Complete Tutorial: React Admin Panel with refine and daisyUI
    5 projects | dev.to | 24 Oct 2023
    We have to install refine's support packages for React Table and React Hook Form. We are using Tailwind Heroicons for our icons, the Day.js library for time calculations and Recharts library to plot our charts for KPI data. So, run the following and we are good to go:
  • Managify: Manage Your Teams Easily
    6 projects | dev.to | 20 Jul 2023
    DayJS is a lightweight and fast JavaScript library for manipulating dates and times. It offers a moment.js-like API but with a much smaller footprint.
  • is there a date calculate script/libary ?
    2 projects | /r/learnjavascript | 11 Jul 2023
  • What library do you use to handle dates?
    2 projects | /r/learnjavascript | 9 Jun 2023
    I use Day.js in my projects.
  • Flash News App React Native (Expo^)
    3 projects | /r/reactnative | 5 Jun 2023
    well, I haven't reviewed the code, I just checked package.json and I'll suggest you to ditch moment.js Even the creator recommends ditching it. dayjs is a fantastic alternative.

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 2024-04-02.
  • 8 NPM Packages for JavaScript Beginners [2024][+tutorials]
    6 projects | dev.to | 2 Apr 2024
    Lodash.js is like the Swiss Army knife for JavaScript developers. Need to manipulate data structures or dabble in functional programming? Lodash is here to save the day with its arsenal of utilities. It's all about making your code cleaner and your life easier, which is probably why big guns like Google and Airbnb have it in their toolkit.
  • Full Stack Web Development Concept map
    11 projects | dev.to | 23 Mar 2024
    lodash - utility library enabling things like deep object comparison that aren't easy to do with javascript out of the box. docs
  • JavaScript Libraries That You Should Know
    8 projects | dev.to | 19 Mar 2024
    5. Lodash
  • Top 20 Frontend Interview Questions With Answers
    7 projects | dev.to | 3 Feb 2024
    It's also important to ensure that you're importing libraries correctly, so webpack can perform tree shaking effectively. For example, let's import lodash, as follows:
  • Coming to grips with JS: a Rubyist's deep dive
    16 projects | dev.to | 29 Dec 2023
    lodash and You Might Not Need Lodash
  • Deep Cloning Objects in JavaScript, the Modern Way
    8 projects | news.ycombinator.com | 21 Dec 2023
    A lot of Lodash functions are implemented as combinations of other Lodash functions, so importing a single function actually imports half of Lodash under the hood:

    https://github.com/lodash/lodash/blob/main/src/.internal/bas...

  • 5 best JavaScript multidimensional array libraries
    4 projects | dev.to | 5 Dec 2023
    Lodash is a popular utility library that provides a wide range of methods for dealing with arrays, collections, and objects. Lodash, while not expressly built for multidimensional arrays, may be a useful tool for fundamental array operations.
  • 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.

What are some alternatives?

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

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

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

moment - Parse, validate, manipulate, and display dates in javascript.

ramda - :ram: Practical functional Javascript

underscore - JavaScript's utility _ belt

moment-timezone - Timezone support for moment.js

lazy.js - Like Underscore, but lazier

RxJS

Sugar - A Javascript library for working with native objects.

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

Mout - Modular JavaScript Utilities

countdown.js - Super simple countdowns.