Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

@cheezitman/streak-counter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cheezitman/streak-counter

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

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Streak Counter

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

Install

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

Usage

import { streakCounter } from "@jsjoeio/streak-counter";

const today = new Date();

const streak = streakCounter(localStorage, today);

// Streak returns an object:
// {
//    currentCount: 1;
//    lastLoginDate: 
}

FAQs

Package last updated on 08 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts