Skip to content

SazedWorldbringer/streak-counter

Repository files navigation

@sazed/streak-counter - a basic streak counter

This is a basic streak counter - inspired by Duolingo, and made following Joe Previte's course - written in TypeScript and meant for the browser (uses localStorage).

Install

yarn add @sazed/streak-counter

Usage

import { streakCounter } from '@sazed/streak-counter';

const today = new Date();
const streak = streakCounter(localStorage, today);

streak returns an object:

{
	currentCount: 1,
	lastLoginDate: "01/24/2023",
	startDate: "01/24/2023",
}

Edit streak-counter (ts-course) (forked)

About

A streak counter for the browser, inspired by Duolingo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published