Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/facuperezm/streak-counter

👨🏻‍🏫 A streak counter for the browser, inspired by Duolingo.
https://github.com/facuperezm/streak-counter

Last synced: 2 days ago
JSON representation

👨🏻‍🏫 A streak counter for the browser, inspired by Duolingo.

Awesome Lists containing this project

README

        

# `@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

```shell
npm install @facuperezm/streak-counter
```

## Usage

```javascript
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
```