# @f/queue

> Simple function queue

Latest version **1.0.2** (published 2016-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/queue
pnpm add @f/queue
yarn add @f/queue
bun add @f/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.0.2 |
| Published | 2016-03-11 |
| First published | 2016-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/queue
- Repository: https://github.com/micro-js/queue
- Homepage: https://github.com/micro-js/queue#readme
- Issues: https://github.com/micro-js/queue/issues
- npm.io page: https://npm.io/package/@f/queue

## Dependencies (1)

- [@f/map-array](https://npm.io/package/@f/map-array.md) ^1.2.1

## Recent versions

- 1.0.2 (latest) — 2016-03-11
- 1.0.1 — 2016-02-25
- 1.0.0 — 2016-02-25

## README

# queue

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Simple function queue

## Installation

    $ npm install @f/queue

## Usage

```js
var createQueue = require('@f/queue')
var queue = createQueue()

queue.push(function () {
  console.log('hello world')
})

queue.flush()
```

Or in ES6:

```javascript
import createQueue from '@f/queue'

const {add, flush} = createQueue()
add(() => console.log('hello world'))

setTimeout(flush)
```

## API

### queue()

**Returns:** An object containing two functions, `add` and `flush`:

  * `add(fn)` - Add `fn` to the queue.
  * `flush()` - Flush the queue - i.e., run all the `fns`, clear the queue, and return an array of their return values.

Note that queue does not use a prototype, so you can call `flush` and `add` without invoking them on the queue object.



## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/queue.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/queue
[git-image]: https://img.shields.io/github/tag/micro-js/queue.svg?style=flat-square
[git-url]: https://github.com/micro-js/queue
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/queue.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/queue

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