# cogsworth-storage-memory

> easy & capable scheduling for node & the browser

Latest version **0.0.3** (published 2017-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cogsworth-storage-memory
pnpm add cogsworth-storage-memory
yarn add cogsworth-storage-memory
bun add cogsworth-storage-memory
```

## 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.0.3 |
| Published | 2017-07-15 |
| First published | 2017-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | cdaringe |
| Maintainers | cdaringe |
| Keywords | schdeule, scheduler, cron, rrule, rfc5545, rfc2245, ical, icalendar, job |

## Links

- npm: https://www.npmjs.com/package/cogsworth-storage-memory
- Repository: https://github.com/cdaringe/cogsworth
- Homepage: https://github.com/cdaringe/cogsworth#readme
- Issues: https://github.com/cdaringe/cogsworth/issues
- npm.io page: https://npm.io/package/cogsworth-storage-memory

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-07-15
- 0.0.2 — 2017-07-11

## README

# cogsworth

easy &amp; capable scheduling for node &amp; the browser

[ ![Codeship Status for cdaringe/cogsworth](https://app.codeship.com/projects/e6cd4ce0-4bd1-0135-2de1-02fedcef81c5/status?branch=master)](https://app.codeship.com/projects/232848)

<img src="https://github.com/cdaringe/cogsworth/blob/master/img/cogsworth.gif?raw=true" alt="cogsworth" />

## what

a scheduling suite.  use it to:

- load events, recurrences, or intervals into the system
  - you get [cron](https://en.wikipedia.org/wiki/Cron) & [iCalendar](https://icalendar.org/) support out of the box
- have the system emit an event or call a function when a scheduled event is triggered

for example,

- "make an API call every 10 minutes"
- "run a backup every month"
- "call my sister every 20 seconds"

it ships with:

- a [`Scheduler`](https://github.com/cdaringe/cogsworth/tree/master/packages/scheduler)
  - inspired by the all-to-rad Java Quartz scheduler
- a [`micro`](https://github.com/cdaringe/cogsworth/tree/master/packages/micro)service
  - an easy plug-n-play REST API to load & interact with schedule ticks
- various [extendable scheduling primatives](https://github.com/cdaringe/cogsworth/tree/master/packages) used by the scheduler, such as the Trigger, Schedule, & Storage interfaces (with base classes).

## demo

see [the docsite](https://cdaringe.github.io/cogsworth)

## usage

```javascript
var Scheduler = require('cogsworth-scheduler')
var TriggerRrule = require('cogsworth-trigger-rrule') // e.g. iCal

// create a scheduler & a schedule
var scheduler = new Scheduler()
var schedule = {
  id: 'best_schedule',
  trigger: new TriggerRrule({
    rrule: 'FREQ=SECONDLY;COUNT=5'
  })
}

// add the schedule, start the scheduler, and watch the events stream thru
scheduler.addSchedule(schedule)
.then(scheduler.start.bind(scheduler))
.then(function (observable) {
  observable.subscribe(function logEvent (schedule) {
    console.log(schedule.id, schedule.event.date)
    // best_schedule 2017-07-10T07:26:38.082Z
    // best_schedule 2017-07-10T07:26:39.000Z
    // best_schedule 2017-07-10T07:26:40.000Z
    // best_schedule 2017-07-10T07:26:41.000Z
    // best_schedule 2017-07-10T07:26:42.000Z
  })
})
```

some users may not care for the observable syntax, and may use the following instead:

```js
var scheduler = new Scheduler({
  onTick: function (schedule) {
    console.log(schedule.id, schedule.event.date)
  }
})
scheduler.addSchedule(...).then(scheduler.start.bind(scheduler))
```

this is a boring example with only one schedule.  add as many schedules as you desire!

---
_Source: https://npm.io/package/cogsworth-storage-memory · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
