# thunk-queue

> Thunk queue for uncertainty tasks evaluation.

Latest version **1.2.0** (published 2017-06-04) · 0 weekly downloads

## Install

```sh
npm install thunk-queue
pnpm add thunk-queue
yarn add thunk-queue
bun add thunk-queue
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-06-04 |
| First published | 2015-03-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | zensh |
| Keywords | thunk, thunks, queue, callback |

## Links

- npm: https://www.npmjs.com/package/thunk-queue
- Repository: https://github.com/thunks/thunk-queue
- Issues: https://github.com/thunks/thunk-queue/issues
- npm.io page: https://npm.io/package/thunk-queue

## Dependencies (1)

- [thunks](https://npm.io/package/thunks.md) ^4.8.0

## 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

- 1.2.0 (latest) — 2017-06-04
- 1.1.5 — 2016-10-06
- 1.1.4 — 2016-09-15
- 1.1.3 — 2016-07-24
- 1.1.2 — 2016-05-28
- 1.1.1 — 2016-04-04
- 1.1.0 — 2016-01-23
- 1.0.0 — 2015-11-29
- 0.1.2 — 2015-08-26
- 0.1.1 — 2015-05-09
- 0.1.0 — 2015-03-20

## README

# thunk-queue

Thunk queue for uncertainty tasks evaluation.

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]

## [thunks](https://github.com/thunks/thunks)

## Demo

```js
const thunkQueue = require('thunk-queue')
const queueT = thunkQueue()

queueT(function(err, res) {
  // It is will be run after all thunkable task finished in queue.
  console.log(err, res)
})

queueT.push(1) // push a primitive value to queue
queueT.push(Promise.resolve(1)) // push a promise to queue

// queueT.push(...), support all thunkable value, such as primitive value, thunk function, promise, generator object, generator function...

queueT.end() // end the queue.
```

## Installation

```bash
npm install thunk-queue
```

## API

```js
const thunkQueue = require('thunk-queue')
```

### thunkQueue([thunkable])

Return a thunk function with a closure queue.

```js
const queueT = thunkQueue()
```

#### queueT.push(thunkable)

Push thunkable task to the `thunk`'s queue, thunkable task will be eager evaluated, return the `queueT`;

#### queueT.end([thunkable])

End the `thunk`'s queue. the `thunk` will be evaluated after all tasks finished in queue. return the `queueT`;


[npm-url]: https://npmjs.org/package/thunk-queue
[npm-image]: http://img.shields.io/npm/v/thunk-queue.svg

[travis-url]: https://travis-ci.org/thunks/thunk-queue
[travis-image]: http://img.shields.io/travis/thunks/thunk-queue.svg

[downloads-url]: https://npmjs.org/package/thunk-queue
[downloads-image]: http://img.shields.io/npm/dm/thunk-queue.svg?style=flat-square

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