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

@xarlizard/react-temporal

v0.0.2

Published

A comprehensive React hooks library for date and time management using the JavaScript Temporal API. Provides custom hooks for all common date, time, calendar, and timezone needs in React projects.

Downloads

2

Readme

react-temporal

npm version License: MIT TypeScript CI/CD

react-temporal is a comprehensive React hooks library for date and time management, powered by the new JavaScript Temporal API. It aims to be the only required library for handling dates, times, durations, calendars, and time zones in React projects.


🚀 Install

npm install @xarlizard/react-temporal

📦 Usage

All hooks are named exports:

import { useTemporalNow, useTemporalMonth } from 'react-temporal';

function Clock() {
  const now = useTemporalNow();
  return <div>Current time: {now.toString()}</div>;
}

🧩 Hooks Overview

| Hook | Description | | ---------------------- | --------------------------------------------------------------------- | | useTemporalNow | Returns the current Temporal.Instant, updating every second. | | useTemporalInterval | Runs a callback at a given Temporal.Duration interval. | | useTemporalDuration | Returns a Temporal.Duration between two instants. | | useTemporalCalendar | Returns a Temporal.Calendar instance for a given calendar ID. | | useTemporalTimeZone | Returns a Temporal.TimeZone instance for a given time zone ID. | | useTemporalFormat | Formats a Temporal object using Intl.DateTimeFormat. | | useTemporalRange | Returns an array of Temporal.PlainDate between start and end. | | useTemporalRelative | Returns a human-readable relative time string between two instants. | | useTemporalCountdown | Returns the remaining seconds until a target instant. | | useTemporalSchedule | Schedules a callback to run at a specific instant. | | useTemporalParse | Parses an ISO string to Temporal.Instant. | | useTemporalDiff | Returns the difference between two instants as a Temporal.Duration. | | useTemporalWeek | Returns all dates in the week of a given Temporal.PlainDate. | | useTemporalMonth | Returns all dates in the month of a given Temporal.PlainDate. | | useTemporalYear | Returns all months in the year of a given Temporal.PlainDate. |


Example Hooks

useTemporalNow

Returns the current Temporal.Instant, updating every second.

const now = useTemporalNow();

useTemporalMonth

Returns all dates in the month of a given Temporal.PlainDate.

const dates = useTemporalMonth(Temporal.PlainDate.from('2025-07-01'));

useTemporalCountdown

Returns the remaining seconds until a target Temporal.Instant.

const remaining = useTemporalCountdown(Temporal.Instant.from('2025-08-01T00:00:00Z'));

...and many more!

See examples/ for more usage patterns.


🧪 Testing

All hooks are covered by unit tests in src/__tests__/. Run tests with:

npm test

🛠️ Development

  • Clone the repo: git clone https://github.com/xarlizard/react-temporal.git
  • Install dependencies: npm install
  • Run tests: npm test
  • Build: npm run build

🤝 Contributing

Contributions are welcome! Please open issues or submit pull requests.


📄 License

MIT © xarlizard