Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@date-io/luxon
Advanced tools
@date-io/luxon is a date utility library that provides a consistent API for working with dates and times using the Luxon library. It is commonly used in conjunction with Material-UI pickers to handle date and time operations in a standardized way.
Parsing Dates
This feature allows you to parse dates from various formats. In this example, an ISO date string is parsed into a Luxon DateTime object.
const { DateTime } = require('luxon');
const date = DateTime.fromISO('2023-10-01');
console.log(date.toString());
Formatting Dates
This feature allows you to format dates into different string representations. In this example, the current date is formatted into a 'yyyy LLL dd' format.
const { DateTime } = require('luxon');
const date = DateTime.local();
console.log(date.toFormat('yyyy LLL dd'));
Date Arithmetic
This feature allows you to perform arithmetic operations on dates. In this example, 5 days are added to the current date.
const { DateTime } = require('luxon');
const date = DateTime.local();
const newDate = date.plus({ days: 5 });
console.log(newDate.toString());
Timezone Support
This feature allows you to work with dates in different timezones. In this example, the current date is set to the 'America/New_York' timezone.
const { DateTime } = require('luxon');
const date = DateTime.local().setZone('America/New_York');
console.log(date.toString());
Moment.js is a widely-used library for parsing, validating, manipulating, and formatting dates. It is similar to Luxon but is considered more heavyweight and has been deprecated in favor of more modern libraries like Luxon.
date-fns provides a comprehensive set of functions for working with dates in JavaScript. It is modular and tree-shakeable, making it a lighter alternative to Moment.js and Luxon.
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times. It is similar to Moment.js but is much smaller in size and has a largely compatible API.
This project is a part of date-io monorepo and contains the unified interface of luxon.
Get more information here
FAQs
Abstraction over common javascript date management libraries
The npm package @date-io/luxon receives a total of 520,613 weekly downloads. As such, @date-io/luxon popularity was classified as popular.
We found that @date-io/luxon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.