# @nicollguarnizo/streak-counter

> a streak counter for the browser, inspired by Duolingo.

Latest version **0.0.1** (published 2022-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nicollguarnizo/streak-counter
pnpm add @nicollguarnizo/streak-counter
yarn add @nicollguarnizo/streak-counter
bun add @nicollguarnizo/streak-counter
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-03-14 |
| First published | 2022-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nicoll |
| Maintainers | nicollguarnizo |

## Links

- npm: https://www.npmjs.com/package/@nicollguarnizo/streak-counter
- Repository: https://github.com/NicollGuarnizo/streak-counter
- Homepage: https://github.com/NicollGuarnizo/streak-counter#readme
- Issues: https://github.com/NicollGuarnizo/streak-counter/issues
- npm.io page: https://npm.io/package/@nicollguarnizo/streak-counter

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) ^4.6.2

## Recent versions

- 0.0.1 (latest) — 2022-03-14

## README

# streak-counter
a streak counter for the browser, inspired by Duolingo.

# `@jsjoeio/streak-counter` - a basic streak counter

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

## Install

```shell
yarn add @jsjoeio/streak-counter
```

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

### Usage

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

const today = new Date();
const streak = streakCounter(localStorage, today);
// streak returns an object:
// {
//    currentCount: 1,
//    lastLoginDate: "11/11/2021",
//    startDate: "11/11/2021",
// }
```

---
_Source: https://npm.io/package/@nicollguarnizo/streak-counter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
