New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kev_nz/async-tools

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kev_nz/async-tools - npm Package Compare versions

Comparing version

to
1.2.0

src/__tests__/do-while.test.js

2

package.json
{
"name": "@kev_nz/async-tools",
"version": "1.1.1",
"version": "1.2.0",
"description": "Async tools - a collection of utility functions for working with async/await code.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -147,2 +147,33 @@ # Async Tools

```
### Do While
Execute an async function while a condition is true
```javascript
const { doWhile } = require('@kev_nz/async-tools')
(async () => {
const results = await doWhile(async () => {
await asyncFunction()
}, () => something === true)
})()
```
### While Do
While a condition is true execute an async function
```javascript
const { whileDo } = require('@kev_nz/async-tools')
(async () => {
const results = await whileDo(
() => something === true),
async () => {
await asyncFunction()
})
})()
```
### Test Coverage

@@ -149,0 +180,0 @@