1.0.0 • Published 2 years ago

@jquince/streak-counter v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@jquince/streak-counter - A streak counter to cheers users progress

This is a streak counter - Inspired by Duolingo- But for browser and use localStorage

Install

 npm @jquince/streak-counter
 yarn @jquince/streak-counter

Usage

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

const today = new Date();

const streak = streakCounter(localStorage, today);

/**
 *  streak returns an object
 *
 * {
 *  currentCount: 1,
 *  lastLoginDate: '11/11/11
 *  startDate: '09/11/10'
 * }
 * /
1.0.0

2 years ago