npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

neocoredate

v1.7.0

Published

Lightweight and powerful JavaScript/TypeScript library for date manipulation, validation, and formatting.

Readme

NeoCoreDate

NeoCoreDate is a TypeScript library designed to help developers with date validation, formatting, and manipulation. It supports various date formats and provides useful functions to work with dates in a simple and efficient manner.

Features

  • Date Validator: Validate dates based on a given format (e.g., yyyy-mm-dd, dd-mm-yyyy).
  • Date Formatter: Format dates into different formats (e.g., yyyy-mm-dd, DD/MM/YYYY).
  • Date Manipulator: Perform operations like adding or subtracting days, months, etc., and format the results.
  • Date Comparator: Compare dates to check if one is earlier, later, or on the same day as another, and calculate the time remaining until a target date.

Installation

npm install neocoredate

Usage

1. Date Validation

The DateValidator class allows you to check whether a date is valid based on a specific format.

Example:

import { DateValidator } from 'neocoredate';

const validDate = '2025-02-01';
const invalidDate = '2025-02-31';

console.log(`Is the date ${validDate} valid?`, DateValidator.isValid(validDate, 'yyyy-mm-dd')); // true
console.log(`Is the date ${invalidDate} valid?`, DateValidator.isValid(invalidDate, 'yyyy-mm-dd')); // false

2. Date Formatting

The DateFormatter class allows you to format dates into various formats.

Example:

import { DateFormatter } from 'neocoredate';

const date = new Date('2025-02-01T12:34:56');

console.log('Brazilian format:', DateFormatter.formatToBrazilian(date)); // Ex: 01/02/2025
console.log('ISO format without time:', DateFormatter.formatToISO(date)); // Ex: 2025-02-01
console.log('Custom format:', DateFormatter.format(date, 'DD/MM/YYYY')); // Ex: 01/02/2025

3. Date Manipulation

The DateManipulator class allows you to add or subtract days and months from a given date.

Example:

import { DateManipulator, DateFormatter } from 'neocoredate';

const date = new Date('2025-02-01T12:34:56');

const newDate = DateManipulator.addDays(date, 5);
console.log('Date after adding 5 days:', DateFormatter.formatToISO(newDate)); // Ex: 2025-02-06

const subtractedDate = DateManipulator.subtractDays(date, 5);
console.log('Date after subtracting 5 days:', DateFormatter.formatToISO(subtractedDate)); // Ex: 2025-01-27

const addedMonthsDate = DateManipulator.addMonths(date, 2);
console.log('Date after adding 2 months:', DateFormatter.formatToISO(addedMonthsDate)); // Ex: 2025-04-01

const subtractedMonthsDate = DateManipulator.subtractMonths(date, 2);
console.log('Date after subtracting 2 months:', DateFormatter.formatToISO(subtractedMonthsDate)); // Ex: 2025-12-01

4. Date Comparison

The DateComparator class allows you to compare dates and calculate the time until a target date.

Example:

import { DateComparator } from 'neocoredate';

const date1 = '2025-02-01';
const date2 = '2025-03-01';

console.log('Is date1 earlier than date2?', DateComparator.isEarlier(date1, date2)); // true
console.log('Is date1 later than date2?', DateComparator.isLater(date1, date2)); // false
console.log('Is date1 the same day as date2?', DateComparator.isSameDay(date1, date2)); // false

const targetDate = '2025-12-25';
console.log('Time until target date:', DateComparator.timeUntil(targetDate)); // Ex: "327 days, 14 hours, 30 minutes, and 12 seconds"

License

MIT License. See LICENSE for more information.