Socket
Socket
Sign inDemoInstall

aceink

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aceink

Async tools


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

aceink

Useful async tools.

  • createLock
    • a simple counting sempahore
  • createDeferred
    • simple deferred promise
  • q
    • a concurrent work queue
  • each, map
    • optionally concurrent iteration functions
  • gowait
    • convert a promise or promise returning function to [error,result] tuples
  • delay
    • delay ms, optionally resolve an argument
  • noop, identity, once
    • Other useful language functions

Get it on npm: npm install aceink

See the generated documentation here


Example (queue)

import { q } from 'aceink'

const { ready, add, empty } = q(10)

function fetchQux(bar) {
  return fetch(`https://example.com/${bar}`)
}

for (const foo of Array(100).keys()) {
  await ready()
  add(fetchQux, foo)
}
return empty()

Example (gowait)

import { gowait, delay } from 'aceink'

const [err, value] = await gowait(delay(100, 42))
console.log(value) //42

FAQs

Package last updated on 13 Sep 2023

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