use-datetime-countdown
v1.0.1
Published
A customizable countdown hook for React
Downloads
6
Readme
use-datetime-countdown
A customizable countdown hook for React
Installation
To install the package, use npm:
pnpm add use-datetime-countdown
yarn install use-datetime-countdown
npm install use-datetime-countdown
Usage
import { useDatetimeCountdown } from 'use-datetime-countdown';
const date = new Date('2025-01-01T01:00:00.001Z');
const datetime = useDatetimeCountdown();
console.log(datetime);
// {
// days: ...,
// hours: ...,
// minutes: ...,
// seconds: ...,
// }
tsup
Bundle your TypeScript library with no config, powered by esbuild.
https://tsup.egoist.dev/
How to use this
- install dependencies
# pnpm
$ pnpm install
# yarn
$ yarn install
# npm
$ npm install
- Add your code to
src
- Add export statement to
src/index.ts
- Test build command to build
src
. Once the command works properly, you will seedist
folder.
# pnpm
$ pnpm run build
# yarn
$ yarn run build
# npm
$ npm run build
- Publish your package
$ npm publish
test package
https://www.npmjs.com/package/use-datetime-countdown