Comparing version 2.1.2 to 2.2.1
'use strict'; | ||
// Load modules | ||
// Declare internals | ||
const internals = {}; | ||
@@ -9,0 +4,0 @@ |
{ | ||
"name": "items", | ||
"description": "Bare minimum async methods", | ||
"version": "2.1.2", | ||
"version": "2.2.1", | ||
"repository": "git://github.com/hapijs/items", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"main": "lib/index.js", | ||
@@ -12,12 +15,15 @@ "keywords": [ | ||
], | ||
"files": [ | ||
"lib" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"code": "4.x.x", | ||
"lab": "13.x.x" | ||
"lab": "14.x.x" | ||
}, | ||
"scripts": { | ||
"test": "lab -a code -t 100 -L -I SharedArrayBuffer,Atomics", | ||
"test-cov-html": "lab -a code -r html -o coverage.html -I SharedArrayBuffer,Atomics" | ||
"test": "lab -a code -t 100 -L -l", | ||
"test-cov-html": "lab -a code -r html -o coverage.html -l" | ||
}, | ||
"license": "BSD-3-Clause" | ||
"license": "SEE LICENSE IN LICENSE.md" | ||
} |
@@ -1,44 +0,20 @@ | ||
#items | ||
<a href="https://hapi.dev"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a> | ||
Bare minimum async methods adapted specifically for the very limited **hapi** core use cases. Use | ||
[async](https://github.com/caolan/async) for all your application needs. | ||
# items | ||
[![Build Status](https://secure.travis-ci.org/hapijs/items.png)](http://travis-ci.org/hapijs/items) | ||
## License | ||
Lead Maintainer - [Eran Hammer](https://github.com/hueniverse) | ||
This package requires a commercial license. You may not use, copy, or distribute it without first acquiring a commercial license from Sideway Inc. Using this software without a license is a violation of US and international law. For more information about available licenses please check https://hapi.dev/support. | ||
## `Items.serial(items, method, callback)` | ||
#### Bare minimum async methods adapted specifically for the very limited **hapi** core use cases. | ||
Runs `method` against each value in the `items` array *in series*. `callback` is executed when all of the tasks are complete. Calling back with an error will short-circuit the remaining tasks. | ||
**items** is part of the **hapi** ecosystem and was designed to work seamlessly with the [hapi web framework](https://hapi.dev) and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out [hapi](https://hapi.dev) – they work even better together. | ||
- `items` an array of items to pass to `method`. | ||
- `method` a function with the signature `function (item, next, i)`. | ||
- `item` - is the currently processing item in the `items` array. | ||
- `next` - callback function to indicate the end of processing for `item`. Calling `next` with a truthy parameter indicates an error and ends `Items.serial`. | ||
- `i` - The current item's index in the `items` array. | ||
- `callback` - a function with the signature `function (err)`. | ||
- `err` - indicates any errors during processing. | ||
### Visit the [hapi.dev](https://hapi.dev) Developer Portal for tutorials, documentation, and support | ||
## `Items.parallel(items, method, callback)` | ||
## Useful resources | ||
Runs `method` against each value in the `items` array *in parallel*. `callback` is executed when all of the tasks are complete. Calling back with an error will short-circuit the remaining tasks. | ||
- `items` an array of items to pass to `method`. | ||
- `method` a function with the signature `function (item, next, i)`. | ||
- `item` - is the currently processing item in the `items` array. | ||
- `next` - callback function to indicate the end of processing for `item`. Calling `next` with a truthy parameter indicates an error and ends `Items.parallel`. | ||
- `i` - The current item's index in the `items` array. | ||
- `callback` - a function with the signature `function (err)`. | ||
- `err` - indicates any errors during processing. | ||
## `Items.parallel.execute(tasks, callback)` | ||
Runs all of the functions in `tasks` *in parallel* and stores the results in a collector object passed into `callback`. If any of the tasks callback with an error, the collector object is `null`. | ||
- `tasks` - on object containing functions to execute in parallel. The `key` of the function is the `key` in the result of collector object. The task should have the signature `function (next)` | ||
- `next(err, result)` - callback function to indicate the end of processing for the current task. | ||
- `err` - indicates any errors during processing. | ||
- `result` - result of this function. This value will be set on the collector object in the final callback. | ||
- `callback(err, result)` | ||
- `err` - any errors reported by *any* of the `tasks`. | ||
- `result` - an object containing the result of running all of the `tasks`. `result` will be `null` if any of the tasks callback with an error. The `result.key` will be the corresponding `key` of the `tasks` object. | ||
- [Documentation and API](https://hapi.dev/family/items/) | ||
- [Version status](https://hapi.dev/resources/status/#items) (builds, dependencies, node versions, licenses, eol) | ||
- [Project policies](https://hapi.dev/policies/) | ||
- [Free and commercial support options](https://hapi.dev/support/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
4828
4
1
1
80
88
21
1