# lokue

> LokiJS Task Queue

Latest version **0.0.9** (published 2024-08-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install lokue
pnpm add lokue
yarn add lokue
bun add lokue
```

## 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.9 |
| Published | 2024-08-08 |
| First published | 2017-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | prdn |
| Maintainers | vigan-abd, bitfinexorg, prdn, mafintosh |
| Keywords | bitfinex |

## Links

- npm: https://www.npmjs.com/package/lokue
- Repository: https://github.com/bitfinexcom/lokue
- Issues: https://github.com/bitfinexcom/lokue/issues
- npm.io page: https://npm.io/package/lokue

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [async](https://npm.io/package/async.md) ^2.6.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [lokijs](https://npm.io/package/lokijs.md) ^1.5.5

## Recent versions

- 0.0.9 (latest) — 2024-08-08
- 0.0.8 — 2018-08-10
- 0.0.7 — 2018-08-05
- 0.0.6 — 2017-07-04
- 0.0.5 — 2017-06-26
- 0.0.4 — 2017-04-27
- 0.0.3 — 2017-04-26
- 0.0.2 — 2017-04-26
- 0.0.1 — 2017-04-26

## README

# lokue: LokiJS Job Queue

Simple [LokiJS](http://lokijs.org/) Job Queue management

### Features
* Persist to file
* Fast (configurable concurrency)
* Small library

### Example

```
const Lokue = require('lokue')

const lok = new Lokue({
  name: 'lokue-test.json',
  persist: true,
  concurrency: 10,
  timeout_save: 50,
  timeout_save: 100
})

lok.init((err) => {
  let ix = 0

  setInterval(() => {
    ix++
    lok.addJob({ hello: 'world' + ix })
  }, 100)
})

lok.on('job', job => {
  console.log('processing', job.data)
  job.done()
})

setInterval(() => {
  if (lok.isReady()) {
    lok.requeueStuckJobs()
    lok.clearCompletedJobs()
  }
}, 1000)

process.on('SIGINT', () => {
  if (lok.isReady()) {
    lok.stop(() => {
      console.log('saved')
      process.exit()
    }) 
  } else {
    process.exit()
  }
})
```

### Contributors
* Paolo Ardoino <paolo@bitfinex.com> / <paolo.ardoino@gmail.com>

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