https://github.com/idimetrix/use-datetime-countdown
A customizable countdown hook for React
https://github.com/idimetrix/use-datetime-countdown
Last synced: 6 months ago
JSON representation
A customizable countdown hook for React
- Host: GitHub
- URL: https://github.com/idimetrix/use-datetime-countdown
- Owner: idimetrix
- License: other
- Created: 2024-09-17T07:30:08.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T07:36:37.000Z (8 months ago)
- Last Synced: 2024-11-05T05:42:55.409Z (7 months ago)
- Language: TypeScript
- Size: 59.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# use-datetime-countdown
A customizable countdown hook for React## Installation
To install the package, use npm:
```bash
pnpm add use-datetime-countdownyarn install use-datetime-countdown
npm install use-datetime-countdown
```## Usage
```typescript
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
1. install dependencies
```
# pnpm
$ pnpm install# yarn
$ yarn install# npm
$ npm install
```
2. Add your code to `src`
3. Add export statement to `src/index.ts`
4. Test build command to build `src`.
Once the command works properly, you will see `dist` folder.```zsh
# pnpm
$ pnpm run build# yarn
$ yarn run build# npm
$ npm run build
```
5. Publish your package```zsh
$ npm publish
```## test package
https://www.npmjs.com/package/use-datetime-countdown