# @cjsoto/streak-counter

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

Latest version **0.0.1** (published 2023-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cjsoto/streak-counter
pnpm add @cjsoto/streak-counter
yarn add @cjsoto/streak-counter
bun add @cjsoto/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 | 2023-03-08 |
| First published | 2023-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Carlos J. Soto |
| Maintainers | cjsoto |

## Links

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

## Recent versions

- 0.0.1 (latest) — 2023-03-08

## README

# `@csoto09/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 @csoto09/streak-counter
```

or

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

## Usage

```jsx
import {streakCounter} from '@csoto09/streak-counter'

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

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