# qalllib

> q all sync and async

Latest version **1.2.1** (published 2018-06-29) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2018-06-29 |
| First published | 2018-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | amey.chavan@b2x.com |
| Maintainers | ameychavan, chetan07j |
| Keywords | q, sync, async |

## Links

- npm: https://www.npmjs.com/package/qalllib
- Repository: https://github.com/B2XCare/qalllib
- Homepage: https://github.com/B2XCare/qalllib#readme
- Issues: https://github.com/B2XCare/qalllib/issues
- npm.io page: https://npm.io/package/qalllib

## Dependencies (1)

- [q](https://npm.io/package/q.md) 1.5.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-06-29
- 1.2.0 — 2018-06-29
- 1.1.0 — 2018-06-29
- 1.0.0 — 2018-06-27

## README

# qalllib
 

*Description*

3 wrapper functions to reduce the qall complexity .

qalllib.qSyncAll(functionName, arrayOfElements) 
qalllib.qAsyncAll(functionName, arrayOfElements) 
qalllib.qASyncWithBatch(functionName, arrayOfElements, batchSize)

# Params:
1.  functionName=function should always return promise.
2.  arrayOfElements: is array for which the qall has to be executed .
3. -batchSize : interger default 10 batch size is to limit the async call to batch. helps to reduce overloading.

# EXAMPLE
pass array to add function with batch size 3

```javascript

let add = function(num, ...args) {
    let defer = q.defer()
    setTimeout(function() {
        (num % 2 === 0) ? defer.resolve(num + num): defer.reject({
            'lol': num
        })
    }, 1000)

    return defer.promise
}



    qalllib.qASyncWithBatch(add, [1,2,3,4,5], 3) 
    	.then(function(data) {
            console.log((new Date()).toTimeString().slice(0, 8), 'end executing:');
            console.log(data);
        })
        .catch(function(error) {
            console.log('error in catch', error)
        })
        .done(console.log('promise done'))
```

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