New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

datefinder

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datefinder

A Node package for locating dates inside text

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Datefinder

Description

It finds dates in your text with Node JS and returns extracted strings, start and end indices, the date object. It works for English, Russian and Ukrainian languages in the date range from 1900 to 2000.

Parameters

Method can be called by datefinder(text), where text is your text.

Installation

npm install datefinder --save

Usage

const dateFinder = require('datefinder')

let text = 'Це трапилося 2 січня 2001 року. Я отримав листа, на якому була зазначена дата 12.12.2004.'

console.log(dateFinder(text))

Expected outcome:

[ { startIndex: 12,
    endIndex: 30,
    string: ' 2 січня 2001 року',
    date: 2001-01-02T00:00:00.000Z },
  { startIndex: 78,
    endIndex: 88,
    string: '12.12.2004',
    date: 2004-12-12T00:00:00.000Z } ]

Acknowledgement

This package was inspired by akoumjian's datefinder.

License

MIT

Keywords

date

FAQs

Package last updated on 07 Jul 2020

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