Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/facuperezm/streak-counter
- Owner: facuperezm
- License: mit
- Created: 2023-02-04T13:36:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T12:51:53.000Z (almost 2 years ago)
- Last Synced: 2024-11-01T08:47:24.560Z (15 days ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@facuperezm/streak-counter
- Size: 151 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```