Gathering detailed insights and metrics for use-countdown-timer
Gathering detailed insights and metrics for use-countdown-timer
Gathering detailed insights and metrics for use-countdown-timer
Gathering detailed insights and metrics for use-countdown-timer
react-countdown-hook
Dead simple yet powerful countdown hook for React.
use-react-timer
Minimal timer hook for react and react native
react-native-use-countdown
useCountdown is a simple, yet powerful React Hook that allows developers to easily create and manage countdown timers in their applications.
react-use-countdown-timer
React Hook for countdown timer.
React hook exposing a countdown timer with optional expiration reset callbacks
npm install use-countdown-timer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (82.99%)
HTML (10.16%)
JavaScript (6.61%)
Dockerfile (0.24%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
32 Stars
101 Commits
5 Forks
1 Watchers
7 Branches
3 Contributors
Updated on Sep 11, 2024
Latest Version
1.3.2
Package Id
use-countdown-timer@1.3.2
Unpacked Size
50.58 kB
Size
9.77 kB
File Count
10
NPM Version
7.19.1
Node Version
16.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
29
React hook exposing a countdown timer with optional expiration and reset callbacks
1npm install --save use-countdown-timer
use-countdown-timer
is written in TypeScript and bundles type definitions.
1export interface ICountdownTimerParams { 2 timer: number; 3 interval?: number; 4 autostart?: boolean; 5 expireImmediate?: boolean; 6 onExpire?: () => void; 7 onReset?: () => void; 8} 9 10export declare type CountdownTimerResults = { 11 countdown: number; 12 isRunning: boolean; 13 start: () => void; 14 reset: () => void; 15 pause: () => void; 16};
1import React from 'react'; 2 3import { useCountdownTimer } from 'use-countdown-timer'; 4 5const Example = () => { 6 const { countdown, start, reset, pause, isRunning } = useCountdownTimer({ 7 timer: 1000 * 5, 8 }); 9 10 return ( 11 <React.Fragment> 12 <div>{countdown}</div> 13 <button onClick={reset}>Reset</button> 14 {isRunning ? ( 15 <button onClick={pause}>Pause</button> 16 ) : ( 17 <button onClick={start}>Start</button> 18 )} 19 </React.Fragment> 20 ); 21};
Local development involves two parts.
First, install and start the library so that it watches src/
directory and automatically recompiles to dist/
on change.
1# clone the repo 2git clone https://github.com/LobsterBandit/use-countdown-timer.git 3 4# install dependencies 5cd use-countdown-timer/ 6npm install 7 8# start rollup in watch mode 9npm start
Second, install and start the example app that is linked to your local use-countdown-timer
version.
1# in second terminal window 2cd example/ 3npm install 4 5# start create-react-app dev server 6npm start
Now, any changes to src/
in the local use-countdown-timer
or to the example app's example/src/
will live-reload the dev server.
MIT © LobsterBandit
This hook is created using create-react-hook.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More