@cheezitman/streak-counter
v0.0.1
Published
This is a basic streak counter - inspired by Duolingo - written in Typescript & meant for the browser (uses `localStorage`).
Downloads
4
Readme
Streak Counter
This is a basic streak counter - inspired by Duolingo - written in Typescript & meant for the browser (uses localStorage).
Install
yarn add @jsjoeio/streak-counternpm install @jsjoeio/streak-counterUsage
import { streakCounter } from "@jsjoeio/streak-counter";
const today = new Date();
const streak = streakCounter(localStorage, today);
// Streak returns an object:
// {
// currentCount: 1;
// lastLoginDate:
}