0.0.1 • Published 1 year ago

@facuperezm/streak-counter v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@facuperezm/streak-counter a basic streak counter

This is a basic streak counter for the browser - inspired by Duolingo - written in TypeScript and meant for the browser (uses localStorage).

Installation

npm install @facuperezm/streak-counter

Usage

import { StreakCounter } from "@facuperezm/streak-counter";

const today = new Date();
const streak = new StreakCounter(localStorage, today);
// streak returned as an object with the following properties:
// currentCount: 0
// lastLoginDate: 11/11/2020
// startDate: 11/11/2020
0.0.1

1 year ago