# @ladjs/simple-recur

> Calculate date recurrence

Latest version **0.3.0** (published 2019-10-10) · UNLICENSE license · 0 weekly downloads

## Install

```sh
npm install @ladjs/simple-recur
pnpm add @ladjs/simple-recur
yarn add @ladjs/simple-recur
bun add @ladjs/simple-recur
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2019-10-10 |
| First published | 2019-10-10 |
| Weekly downloads | 0 |
| License | UNLICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Michiel ter Reehorst |
| Maintainers | niftylettuce |
| Keywords | recur, moment, dayjs, day, date |

## Links

- npm: https://www.npmjs.com/package/@ladjs/simple-recur
- Repository: https://github.com/jamiter/simple-recur
- Issues: https://github.com/jamiter/simple-recur/issues
- npm.io page: https://npm.io/package/@ladjs/simple-recur

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2019-10-10

## README

# simple-recur

![Build status](https://api.travis-ci.org/jamiter/simple-recur.png)

> Calculate date recurrence.  A great alternative to [moment-recur](https://github.com/c-trimm/moment-recur) and [later](https://bunkat.github.io/later/).


## Install

```sh
npm install simple-recur
```


## Options

- `units` (Number)
- `measure` ('weeks', 'months', 'years')
- `start` (Date)
- `from` (Date)


## Examples

> JavaScript:

```js
const Recur = require('simple-recur');
const recur = new Recur(options);

// check if a given date matches this recurrence
const matches = recur.matches(new Date());
console.log('matches', matches);
// outputs: true/false

// get the next 3 occurrences
const nextThreeOccurrences = recur.next(3);
console.log('nextThreeOccurrences', nextThreeOccurrences);
// outputs: [moment, moment, moment]
```

> CoffeeScript:

```coffee-script
Recur = require 'simple-recur'

recur = new Recur
recur.every 2, 'month'

recur.next 3
# outputs: [moment, moment, moment]

recur.matches new Date
# outputs a boolean
```


## Test

```sh
npm test
```


## Build

```sh
npm run build
```


## Watch

```sh
npm run watch
```

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