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

dtrexp-wasm

v1.0.1

Published

DTRExp evaluated by the Rust core, compiled to WebAssembly — compact date-time range & recurrence expressions.

Downloads

321

Readme

dtrexp-wasm

This module is ESM 🔆. Please read this.

DTRExp (read: "DTR Expression") evaluated by the Rust core, compiled to WebAssembly for JS hosts — browsers, Node, Deno, edge runtimes.

T0900:1800 E1:5          Mon–Fri, 09:00–18:00
E7#-1 M4                 last Sunday of April, every year
20200106/10D             every 10 days from 2020-01-06 (cron can't say this)
D13 E5                   every Friday the 13th (cron can't say this either)

Note that for most JS applications the reference implementation, dtrexp, is the right pick; it is pure TypeScript, zero-dependency, and implements the full Tier-2 API (next(), describe(), toRRule()…). This package exists for a different job: running the Rust evaluator itself in a JS host. Use it when your backend already standardizes on dtrexp-rs and you want the same binary logic in the browser, or for cross-implementation parity checks against the reference.

Install

npm i dtrexp-wasm

The wasm binary (~63 KB, ~29 KB gzipped) ships inside the package and instantiates at import; no fetch configuration, no separate asset step.

Usage

import { parse, validate } from 'dtrexp-wasm';

const dtr = parse('T0900:1800 E1:5'); // business hours
dtr.covers(new Date(), { tz: 'Europe/Berlin' }); // —> true
dtr.covers('2026-07-11T10:00:00Z'); // —> false (a Saturday, evaluated in UTC)

validate('D30 M2');
// —> { valid: true, errors: [], warnings: [{ message: '…unsatisfiable…', position: 0 }] }

The operation vocabulary is fixed across every DTRExp implementation (API.md); if you know one library, you know this one.

API

parse(expression)

  • expression String — Required. The DTRExp source text.

returns a DTRExp instance.

Fails with a positioned DTRExpSyntaxError (position, expression properties) on invalid input. Parse failure is the only failure; a syntactically valid expression never fails later.

validate(expression)

  • expression String — Required. The DTRExp source text.

returns { valid, errors, warnings }; every issue carries a message and a 0-based position. An expression can be valid and warned; that is the point of the distinction.

DTRExp#covers(instant [, opts])

  • instant Date | number | string | { epochMilliseconds } — Required. The instant to test.
  • opts.tz String — Optional. An IANA time-zone identifier (e.g. "Europe/Berlin"). Default: "UTC".

returns Boolean.

An unknown zone throws a RangeError; exactly what Intl itself throws for one.

DTRExp#warnings

The spec §9.1 unsatisfiability warnings of a parsed expression; same content as validate(source).warnings, exposed on the instance so code that parses directly doesn't lose them.

Time Zones

WebAssembly has no zoneinfo filesystem, so this package does not ship a time-zone database. Zone lookups are answered by the host's own IANA data through Intl.DateTimeFormat — the same technique the reference implementation uses — which keeps the binary small and the zone data exactly as current as the runtime's. UTC (the default) never touches the bridge and evaluates entirely inside the wasm module.

Conformance

The spec's test vectors are the contract (spec §12); this package vendors vectors.json and runs all of it in its test suite — 97 groups, 409 checks, including the coverage groups evaluated through the Intl zone bridge.

Related Projects

  • dtrexp (spec) — the DTRExp specification (grammar, semantics, conformance vectors) this package implements.
  • dtrexp-rs — the Rust core this package compiles to WebAssembly.
  • dtrexp-js — the reference implementation; the pure-TypeScript alternative on npm.
  • dtrexp-py · dtrexp-go · dtrexp-swift · dtrexp-java — the other implementations; same core interface.

License

MIT — © 2026, Onur Yıldırım.