open-index/open-npm huggingface dataset:
npm package: @lazycuh/execute-until
Description: An utility function to execute an asynchronous operation until it resolves to true
Author: Baby Beet
Latest version: 3.0.1

# execute-until [![](https://circleci.com/gh/lazycuh/execute-until.svg?style=svg&logo=appveyor)](https://app.circleci.com/pipelines/github/lazycuh/execute-until?branch=main)

A function that returns a promise that will only resolve when the predicate function resolves to `true` for async predicate or returns `true` for sync version. This is useful for cases when you need to perform some long running operation before proceeding.

The predicate function will be repeatedly called until it resolves to `true` which causes the asynchronous execution to proceed. By default, the predicate function is called every 500ms.

Please note that this function will reject when the predicate function throws an error/rejects at most 3 times.

## Table of contents

<!-- toc -->

- [Installation](#installation)
- [Example usage](#example-usage)

<!-- tocstop -->

## Installation

- `npm`

  ```
  npm i -S @lazycuh/execute-until
  ```

- `pnpm`

  ```
  pnpm i -S @lazycuh/execute-until
  ```

- `yarn`

  ```
  yarn add @lazycuh/execute-until
  ```

## Example usage

```ts
import { executeUntil } from '@lazycuh/execute-until';

...

await executeUntil(async () => {
  const batchOfDatabaseRows = await fetchNextBatchOfDatabaseRows();

  if (batchOfDatabaseRows.length === 0) {
    /**
     * This will cause `executeUntil()` to terminate.
     */
    return true;
  }

  doSomethingWithBatch(batchOfDatabaseRows);

  /**
   * This will cause `executeUntil()` to run the predicate again.
   */
  return false;
});

doSomethingElseAfterProcessingAllDatabaseRows();

...
```
npm package: @lazycuh/retry
Description: Convenient utilities to retry executing some operation until success or failure at most 3 times
Author: Lazy Cuh
Latest version: 2.0.0

# retry [![](https://circleci.com/gh/lazycuh/retry.svg?style=svg&logo=appveyor)](https://app.circleci.com/pipelines/github/lazycuh/retry?branch=main)

Convenient utilities to retry executing some operation until success or failure at most 3 times.

## Table of contents

<!-- toc -->

- [Installation](#installation)
- [Available APIs](#available-apis)
  - [`retry` function](#retry-function)
  - [`@Retryable` decorator](#retryable-decorator)

<!-- tocstop -->

## Installation

- `npm`

  ```
  npm i -S @lazycuh/retry
  ```

- `pnpm`

  ```
  pnpm i -S @lazycuh/retry
  ```

- `yarn`

  ```
  yarn add @lazycuh/retry
  ```

## Available APIs

### `retry` function

To imperatively retry some operation, wrap your function/method call inside `retry` as followed:

```ts
import { retry } from '@lazycuh/retry';

...

const allUsers = await retry(() => fetchAllUsers(), 1000); // Wait 1000ms between retries, default is 3000ms

...
```

### `@Retryable` decorator

Alternatively, you can decorate your methods using `@Retryable` decorator to add retrying logic to them, be sure that your `tsconfig.json` file has `experimentalDecorators` setting enabled, for example:

```json
{
  "compilerOptions": {
    ...
    "experimentalDecorators": true,
    ...
  },
}
```

```ts
import { Retryable } from '@lazycuh/retry';

...

class UserService {

  @Retryable(2000) // Wait 2000ms between retries, default is 3000ms
  fetchUsers() {
    ...
  }
}

...
```

When `userService.fetchUsers()` is called, any failures will cause it to rerun until either succeeding or failing at most 3 times after the initial failure.
npm package: @lazydb/lazyjs
Description: LazyDB TypeScript / JavaScript client for NodeJS and the Browser.
Author: itzezc
Latest version: 0.0.2

# LazyJS

LazyDB TypeScript / JavaScript client for NodeJS and the Browser.

## About
Feel free to join us on [Discord](https://discord.gg/ruzmwh9)

### NOTE
---

this project is a WIP and in prealpha and therefore unsuitable for production, feel free to submit pull requests and open issues where necessary.

---

## Installation

**NPM**
```
npm i @lazydb/client
```

**Yarn**
```
yarn add @lazydb/client
```

## Documentation
npm package: @lazydb_community/uptimerobot
Description: Async API wrapper for uptimerobot.com V2 API
Author: Victor Chanet - CTO at LazyDB
Latest version: 1.0.1

# uptimrobot API v2

See the doc at [uptimerobot.com/api](https://uptimerobot.com/api/). All methods of the v2 API are available here. Each methods return a promise, wich resolve when uptime robot request is a success and catch otherwise.

## How to use?

All the functions here have the same name as methods on uptimerobot and required params are put as arguments of the functions in the same order.  

Add uptimerobot to your project :

```javascript
const UptimeRobot = require('@lazydb_community/uptimerobot');
const UptimeRobotClient = new UptimeRobot('your-api-key');
```

Then you can use any methods of the uptimerobot.com API v2 like that :  

```javascript
UptimeRobotClient.newMonitor("friendly name","https://mywebsite.com","1", {}).then(data => {
  const monitor_id = data.monitor.id;
  console.log("New monitor created with id ", monitor_id);
}).catch(error => {
  console.log(error);
})
```