@koobawuah/ts_streak-counter
v0.0.2
Published
A streak counter for the browser, inspired by Duolingo - written in TypeScript and meant for the browser (uses 'localStorage').
Downloads
5
Readme
@koobawuah/ts_streak-counter
- a basic streak counter
A streak counter for the browser, inspired by Duolingo - written in TypeScript and meant for the browser (uses 'localStorage').
Install
npm install @koobawuah/ts_streak-counter
Usage
import {streakCounter} from '@koobawuah/ts_streak-counter'
const today = new Date()
const streak - streakCounter(localStorage, today)
// streak returns an object:
// {
// currentCount: 1,
// lastLoginDate: "11/11/2022",
// startDate: "11/11/2022",
// }