# @pmash2/pomo-timer-lib

> Library of methods used for running pomodoro timers

Latest version **0.5.0** (published 2022-01-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @pmash2/pomo-timer-lib
pnpm add @pmash2/pomo-timer-lib
yarn add @pmash2/pomo-timer-lib
bun add @pmash2/pomo-timer-lib
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2022-01-14 |
| First published | 2021-12-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 28.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Phil Ashton |
| Maintainers | pmash2 |

## Links

- npm: https://www.npmjs.com/package/@pmash2/pomo-timer-lib
- Repository: https://github.com/pmash2/pomo-timer-lib
- Homepage: https://github.com/pmash2/pomo-timer-lib#readme
- Issues: https://github.com/pmash2/pomo-timer-lib/issues
- npm.io page: https://npm.io/package/@pmash2/pomo-timer-lib

## Dependencies (1)

- [events](https://npm.io/package/events.md) ^3.3.0

## Recent versions

- 0.5.0 (latest) — 2022-01-14
- 0.4.4 — 2021-12-15

## README

# Pomo-Timer-Lib

Library of methods used to manage and run pomodoro timers

## Usage

Basic usage involves creating two timers, one for a work session and one for a break session. These are then used to create a `Pomodoro`.

```TypeScript
const pLib = require("@pmash2/pomo-timer-lib")

const workSession: Timer = pLib.getTimer(0, 30, 0, 0) // Create 30 min timer
const breakSession: Timer = pLib.getTimer(0, 10, 0, 0) // Create 10 min timer

const pomo: Pomodoro = pLib.getPomodoro(workSession, breakSession)
```

At this point, the pomodoro can be started, stopped, or restarted. Upon the completion of either session (work or break), an event is emitted, which is documented in `Enums.EmitString`:

```js
...
pomo.on(pLib.Enums.EmitString.PomodoroComplete, pomoCompleteFunc)
pomo.on(pLib.Enums.EmitString.BreakComplete, breakCompleteFunc)

await pomo.start()
```

`Enums` also exposes the different states a pomodoro can be in via `Enums.PomodoroState`, which corresponds to the value returned via `.CurrentState` on your pomodoro object.

---
_Source: https://npm.io/package/@pmash2/pomo-timer-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
