CheezItMan / streak-counter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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-counter
npm install @jsjoeio/streak-counter

Usage

import { streakCounter } from "@jsjoeio/streak-counter";

const today = new Date();

const streak = streakCounter(localStorage, today);

// Streak returns an object:
// {
//    currentCount: 1;
//    lastLoginDate: 
}

About

License:MIT License


Languages

Language:TypeScript 97.9%Language:JavaScript 2.1%