Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

items-promise

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

items-promise

Bare minimum async methods using promises

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
856
decreased by-0.35%
Maintainers
1
Weekly downloads
 
Created
Source

items-promise

Bare minimum async methods using promises. (Inspired by items)

>_ yarn add items-promise

OR using NPM

>_ npm install items-promise
const { serial, parallel } = require('items-promise')

// OR

import { serial, parallel } from 'items-promise'

Usage

tasks should be always an array and fn should be a function witch returns a Promise object.

serial(tasks, fn)

Run tasks one by one by calling fn(task, previous) in a promise chain.

Return value is of type Promise<*> which resolves to the last fn result.

parallel(tasks, fn)

Run all tasks in parallel by calling fn(tasks) and await using Promise.all.

Return value is of type Promise<Array[*]> which resolves to results of all fns in an array.

License

Released under The MIT LICENSE

Copyright (c) 2017 Pooya Parsa

FAQs

Package last updated on 03 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc