New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@cuties/async

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cuties/async

Cutie extension for manipulating collections, such as arrays and objects, for controlling the flow through a script, and utility stuff.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

cutie-async

NPM Version Build Status codecov

Cutie extension for processing collections and utility stuff. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/async

Run test

npm test

Run build

npm run build

Usage

const {
  // Needed async objects here from the list below
} = require('@cuties/async')

Collections

Concatenated(collection, iteratee)

Applies iteratee to each item in collection, concatenating the results.

Params:

  • collection: a collection(an array) to iterate over
  • iteratee: a function to apply to each item in collection. It must return some value or a composition of async objects that represents some value.

Filtered(collection, filter)

Filters collection by filter function that returns boolean expression or async object that represents some boolean expression for each item.

Params:

  • collection: a collection(an array) to filter
  • filter: a function to filter collection

GroupedBy(collection, key)

Groups values from collections by key.

Params:

  • collection: a collection(an array) to group by
  • key: a key that collection is grouped by

Mapped(collection, mapper)

Represents array or object that was mapped by mapper from collection. mapper can return async object that precesses each item of collection.

Params:

  • collection: a collection(an array or object) to be mapped
  • mapper: a function for mapping

Rejected(collection, filter)

The opposite of filter.

Utils

Delayed(result, time)

Represents some result that can be used after some specified time. It's a wrapper around setTimeout

Logged(...objs)

Represents objs that have been printed to console.

Keywords

cutie

FAQs

Package last updated on 11 May 2019

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