Socket
Socket
Sign inDemoInstall

chrono-node

Package Overview
Dependencies
Maintainers
0
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrono-node

A natural language date parser in Javascript


Version published
Weekly downloads
321K
increased by5.83%
Maintainers
0
Weekly downloads
 
Created

What is chrono-node?

chrono-node is a natural language date parser in JavaScript. It can parse dates from various date formats and natural language text, making it useful for applications that need to understand and manipulate dates from user input.

What are chrono-node's main functionalities?

Parsing Dates from Natural Language

This feature allows you to parse dates from natural language text. In this example, the text 'Let's meet on Tuesday' is parsed to a Date object representing the next Tuesday.

const chrono = require('chrono-node');
const result = chrono.parseDate('Let's meet on Tuesday');
console.log(result);

Parsing Dates with Specific Time

This feature allows you to parse dates that include specific times. The text 'The event is at 5 PM on 20th October' is parsed to a Date object representing the specified date and time.

const chrono = require('chrono-node');
const result = chrono.parseDate('The event is at 5 PM on 20th October');
console.log(result);

Parsing Relative Dates

This feature allows you to parse relative dates. The text '2 days from now' is parsed to a Date object representing the date two days from the current date.

const chrono = require('chrono-node');
const result = chrono.parseDate('2 days from now');
console.log(result);

Customizing Parsers

This feature allows you to customize the parsers used by chrono-node. In this example, a custom parser is created and used to parse the text 'next Friday'.

const chrono = require('chrono-node');
const customParser = new chrono.Chrono();
customParser.parsers.push(new chrono.Parser());
const result = customParser.parseDate('next Friday');
console.log(result);

Other packages similar to chrono-node

FAQs

Package last updated on 10 Aug 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc