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

@pro-fa/expreszo-datetime

v0.2.1

Published

Optional Luxon-backed date/time functions for the @pro-fa/expreszo expression evaluator.

Downloads

522

Readme

@pro-fa/expreszo-datetime

Optional Luxon-backed date/time functions for @pro-fa/expreszo.

The core @pro-fa/expreszo package never depends on Luxon. Install this companion only when your expressions need date math.

Install

npm install @pro-fa/expreszo @pro-fa/expreszo-datetime

Usage

import { defineParser, fullParser } from '@pro-fa/expreszo';
import { dateTimePlugin }            from '@pro-fa/expreszo-datetime';

const parser = defineParser({ ...fullParser })
  .use(dateTimePlugin);

parser.parse("format(addDuration(now(), 7, 'days'), 'yyyy-MM-dd')").evaluate();

Polymorphic inputs

Every datetime function accepts any of these shapes for date arguments and normalises internally:

  • A Luxon DateTime
  • A JavaScript Date
  • An ISO 8601 string ('2026-01-01T00:00:00Z')
  • A millisecond Unix timestamp

Functions that produce a date return a Luxon DateTime — chain freely:

parser.parse("format(addDuration('2026-01-01', 7, 'days'), 'yyyy-MM-dd')").evaluate();
// => '2026-01-08'

Function reference

~70 functions across the categories below. Full reference with examples in the Date / Time docs page.

  • Construction: now, today, yesterday, tomorrow, parseISO, parseDate, fromMillis, fromUnix, dateTime, date, time
  • Inspection — calendar parts: year, month, day, hour, minute, second, millisecond, quarter, dayOfWeek, dayOfYear, weekOfYear, isoWeekYear, daysInMonth, daysInYear, weeksInYear, offsetMinutes, offsetHours, zoneName, isLeapYear, isDST, isWeekend, isWeekday, isValid
  • Inspection — relative-to-now: isToday, isYesterday, isTomorrow, isThisWeek, isThisMonth, isThisYear, isInPast, isInFuture, age
  • Arithmetic: addDuration, subtractDuration, startOf, endOf, diff, clampDate, minDate, maxDate
  • Comparison: isBefore, isAfter, isSame, isBetween, compareDates, overlapsRange, containsDate
  • Range / sequence: dateRange, businessDaysBetween, weekdaysBetween
  • Distance from now: daysUntil, daysSince, hoursUntil, hoursSince, minutesUntil, minutesSince
  • Format / zone: format, toISO, toMillis, toUnix, toRelative, toRelativeCalendar, setZone, toUTC, toLocal

unit arguments accept 'year'(s), 'quarter'(s), 'month'(s), 'week'(s), 'day'(s), 'hour'(s), 'minute'(s), 'second'(s), 'millisecond'(s) — same vocabulary Luxon uses.

Spread-into-defineParser form

If you prefer the legacy preset composition:

import { defineParser, fullParser } from '@pro-fa/expreszo';
import { withDateTime }              from '@pro-fa/expreszo-datetime';

const parser = defineParser({
  operators: [...fullParser.operators],
  functions: [...fullParser.functions, ...withDateTime.functions]
});