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

@sa0001/luxon-dtz

v0.0.6

Published

[NPM][https://www.npmjs.com/package/@sa0001/luxon-dtz]

Readme

@sa0001/luxon-dtz

[NPM][https://www.npmjs.com/package/@sa0001/luxon-dtz]

A very thin wrapper of luxon.DateTime, which makes some key changes:

  • All static constructors (i.e. fromISO, fromMillis, etc) are wrapped to throw an error if the resulting date is invalid. The default behavior is to allow creating an invalid date, which returns null from all output methods such as toISO.
  • Instance method setZone was wrapped to throw an error if the timezone is not valid. The default behavior is for the current date to become invalid, which returns null from all output methods such as toISO.
  • All static constructors (i.e. fromISO, fromMillis, etc) are wrapped to set the timezone to UTC using toUTC(). As a result, all output (ex. toFormat, toISO) will be in UTC unless the timezone is explicitly set using setZone('...').
  • Static constructor fromISO was changed to only allow a full ISO datetime string with timezone offset or Z (ex. "2001-02-03T04:05:06.789Z"). The default behavior is to accept almost any substring, even missing the date component, time component, or offset/timezone information. When constructing an instance from such a substring, fromFormat should be used instead.

Install

npm install @sa0001/luxon-dtz

Usage

const Dtz = require('@sa0001/luxon-dtz')
let dt

// throw an error if the resulting date is invalid:

dt = Dtz.fromISO('2001-01-01T99:99:99.999Z')
// Error("Invalid DateTime: you specified 99 (of type number) as a hour, which is invalid")

// throw an error if the timezone is invalid:

dt = Dtz.now().setZone('unknown').toISO()
// Error('Invalid DateTime: the zone "unknown" is not supported')

// automatically set timezone to UTC:

dt = Dtz.fromISO('2001-02-03T05:05:06.789+01:00').toISO()
// '2001-02-03T04:05:06.789Z'

dt = Dtz.fromISO('2001-02-03T05:05:06.789+01:00').setZone('UTC+1').toISO()
// '2001-02-03T05:05:06.789+01:00'

// only allow a full ISO datetime string for `fromISO`:

dt = Dtz.fromISO('2001-02-03')
// Error("Invalid ISO format: 2001-02-03")

dt = Dtz.fromISO('04:05:06')
// Error("Invalid ISO format: 04:05:06")

License

MIT