Skip to content

A streak counter for the browser, inspired by Joe Previte's inspiration by Duolingo.

Notifications You must be signed in to change notification settings

guguponce/streak-counter

Repository files navigation

@guguponce/streak-counter - a basic streak counter

This is a basic streak counter - inspired by Joe Previte and his inspiration on Duolingo - written in TypeScript and due to the use of localStorage, it is meant for web browsers.

Install

npm install @guguponce/streak-counter
yarn add @guguponce/streak-counter

Usage import {streakCounter} from '@guguponce/streak-counter'

const today = new Date() const streak = streakCounter(localStorage, today) // streak returns an object: // { // currentCount: 1, // lastLoginDate: "11/11/2021", // startDate: "11/11/2021", // }

About

A streak counter for the browser, inspired by Joe Previte's inspiration by Duolingo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published