# pstack

> pstack

Latest version **0.1.5** (published 2018-08-13) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2018-08-13 |
| First published | 2015-08-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 2 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Julien Loutre |
| Maintainers | 26medias |

## Links

- npm: https://www.npmjs.com/package/pstack
- Repository: https://github.com/26medias/pstack
- Issues: https://github.com/26medias/pstack/issues
- npm.io page: https://npm.io/package/pstack

## Dependencies (2)

- [progress](https://npm.io/package/progress.md) latest
- [underscore](https://npm.io/package/underscore.md) latest

## Recent versions

- 0.1.5 (latest) — 2018-08-13
- 0.1.4 — 2016-06-22
- 0.1.0 — 2016-01-20
- 0.0.6 — 2015-10-03
- 0.0.5 — 2015-08-27
- 0.0.1 — 2015-08-15

## README

# pStack: Sync & Async stacking and queuing #

pStack is an incredibly useful way to create sync and async queues, and get your callback executed once the queue has been processed.

## Install ##

	npm install pstack

## Usage ##

	var pstack = require('pstack');

	var stack = new pstack();
	
	stack.add(function(done) {
		// do something...
		// then execute the callback when the task is done
		done();
	});

	stack.add(function(done) {
		// do something else...
		// then execute the callback when the task is done
		done();
	});

	// Start the queue
	stack.start(function() {
		console.log("The queue has finished processing");
	});

## Options ##

	// Async: All the items in the queue will execute in parallel
	var stack = new pstack({
		async:	true // default to false
	});

	// Show a progress bar in the console
	var stack = new pstack({
		progress: 'Processing the queue... '
	});
	// In the console, you'll see a progress bar:
	// Processing the queue...  [==============    ] 80% [8/10] 0.6s

## Example ##
	
	var pstack = require('pstack');

	var stack = new pstack({
		progress: 'Processing the queue... '
	});
	
	// Add 100 taks, and each will simulate a completing in 200ms
	for (var i=0;i<100;i++) {
		stack.add(function(done) {
			setTimeout(function() {
				done();
			}, 200);
		});
	}

	// Start the queue
	stack.start(function() {
		console.log("The queue has finished processing");
	});

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