open-index/open-npm huggingface dataset:
npm package: @jobrain/retry-x
Description: A tiny, framework-agnostic retry library with smart backoff and jitter.
Latest version: 1.0.2

# retry-x

![npm](https://www.npmjs.com/package/@jobrain/retry-x)
![github](https://github.com/jobrain1/retry-x/tree/main)

A tiny, framework-agnostic retry library that wraps any async function with smart backoff, jitter, and full control — done right.

## Features

- **Exponential backoff**: Wait grows after each failure.
- **Jitter**: Adds randomness to backoff to prevent thundering herd.
- **Max attempts**: Stop after N retries and throw the last error.
- **Max timeout**: Stop retrying after a total elapsed time.
- **`retryIf` condition**: Only retry when a custom function returns `true`.
- **`onRetry` callback**: Hook into each retry attempt for logging / metrics.
- **TypeScript types**: Full type safety out of the box.
- **Zero dependencies**: Extremely lightweight.

## Installation

```bash
npm install retry-x
```

## Usage

### Minimal — works out of the box

```ts
import { retry } from "retry-x";

const data = await retry(() => fetch("https://api.example.com/data"));
```

### Full control

```ts
import { retry } from "retry-x";

const data = await retry(
  () => fetch("https://api.example.com/data"),
  {
    attempts: 5,
    backoff: "exponential",   // or "linear" or "fixed"
    jitter: true,
    timeout: 10_000,          // give up after 10 seconds total
    retryIf: (err, attempt) => err.status === 503,
    onRetry: (err, attempt) => {
      console.log(`Retry #${attempt}:`, err.message);
    },
  }
);
```

If all attempts fail, the last error is thrown — so your existing `try/catch` just works.

## API

### `retry(fn, options?)`

Wraps an async function and retries it based on the provided options. Returns the result of `fn` on success, or throws the last error after all attempts are exhausted.

#### Options

| Option | Type | Default | Description |
|---|---|---|---|
| `attempts` | `number` | `3` | Maximum number of attempts |
| `backoff` | `'exponential' \| 'linear' \| 'fixed'` | `'exponential'` | Backoff strategy between retries |
| `initialDelay` | `number` | `1000` | Initial delay in milliseconds |
| `maxDelay` | `number` | `30000` | Maximum delay in milliseconds |
| `jitter` | `boolean` | `true` | Adds randomness to delay to avoid thundering herd |
| `timeout` | `number` | — | Total timeout across all attempts in milliseconds |
| `retryIf` | `(error, attempt) => boolean` | — | Return `false` to stop retrying early |
| `onRetry` | `(error, attempt) => void` | — | Called before each retry attempt |

## License

MIT
npm package: @jobrouter/api
Description: JobRouter® JavaScript API
Author: JobRouter GmbH
Latest version: 2025.1.19-beta.1

# JobRouter JavaScript API
This package contains definitions for the JobRouter® JavaScript API functions which can be used in dialogs. With these definitions IDEs can provide autocompletion.

## Installation
Using npm
```bash
npm install --save @jobrouter/api
```
or with yarn
```bash
yarn add @jobrouter/api
```
npm package: @jobscale/base32
Description: base32 encode and decode @jobscale/base32
Latest version: 0.2.5

# base32

## Examples

```
const logger = console;
const list = [
  { blob: [0], encoded: 'AA======' },
  { blob: [1, 0], encoded: 'AEAA====' },
  { blob: [1, 2, 0], encoded: 'AEBAA===' },
  { blob: [1, 2, 3, 0], encoded: 'AEBAGAA=' },
  { blob: [1, 2, 3, 4, 0], encoded: 'AEBAGBAA' },
  { blob: [1, 2, 3, 4, 5, 0], encoded: 'AEBAGBAFAA======' },
  { blob: [1, 2, 3, 4, 5, 6, 0], encoded: 'AEBAGBAFAYAA====' },
  { blob: [1, 2, 3, 4, 5, 6, 7, 0], encoded: 'AEBAGBAFAYDQA===' },
  { blob: [1, 2, 3, 4, 5, 6, 7, 8, 0], encoded: 'AEBAGBAFAYDQQAA=' },
  { blob: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], encoded: 'AEBAGBAFAYDQQCIA' },
  { blob: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0], encoded: 'AEBAGBAFAYDQQCIKAA======' },
  { blob: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0], encoded: 'AEBAGBAFAYDQQCIKBMAA====' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0], encoded: 'AEBAGBAFAYAAAAAAAAAAA===' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0], encoded: 'AEBAGBAFAYAAAAAAAAAA====' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0], encoded: 'AEBAGBAFAYAAAAAAAA======' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0, 0, 0], encoded: 'AEBAGBAFAYAAAAAA' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0, 0], encoded: 'AEBAGBAFAYAAAAA=' },
  { blob: [1, 2, 3, 4, 5, 6, 0, 0], encoded: 'AEBAGBAFAYAAA===' },
];

describe('test base32', () => {
  const data = {};
  for (const { blob, encoded } of list) {
    describe(`test list base32 ${blob.length}`, () => {
      it('encoded array toBe prompt', async () => {
        const base32 = new Base32();
        data.encoded = base32.encode(blob);
        expect(data.encoded).toBe(encoded);
      });

      it('decode toStrictEqual prompt', async () => {
        const base32 = new Base32();
        data.binary = base32.decode(data.encoded);
        data.decoded = Array.from(data.binary);
        logger.info(data.encoded, JSON.stringify(data.decoded));
        expect(data.decoded).toStrictEqual(blob);
      });

      it('binary toBe prompt', async () => {
        const base32 = new Base32();
        data.encoded = base32.encode(data.binary);
        expect(data.encoded).toBe(encoded);
      });
    });
  }
});
```
npm package: @jobscale/base64
Description: @jobscale/base64
Author: jobscale
Latest version: 0.1.3

# @jobscale/base64

## Installation

```
npm i @jobscale/base64
```

## Examples

### base64

```javascript
import { logger } from '@jobscale/logger';
import { base64 } from '@jobscale/base64';

const encoded = base64.encode('@jobscale/base64');
const decoded = base64.decoded(encoded);
logger.info({
  timestamp: Date.now(),
  encoded,
  decoded,
});
```

## Jest test
```
npm test
```
npm package: @jobscale/cidr
Description: CIDR IP Address
Author: jobscale
Latest version: 0.1.4

# @jobscale/cidr

## Installation

```
npm i @jobscale/cidr
```

## Examples

### has

```javascript
import { Cidr } from '@jobscale/cidr';
// const { Cidr } = await import('@jobscale/cidr'); // CommonJs

new Cidr('0.0.0.0/0').has('160.160.160.160')

new Cidr('160.160.160.160/32').has('160.160.160.160')

new Cidr('160.160.160.160').has('160.160.160.160');

new Cidr([
  '172.16.0.0/12',
  '160.160.160.160/30',
]).has('160.160.160.160');
```

## Jest test
```
git clone https://github.com/jobscale/cidr.git jobscale-cidr
cd $_
npm test
```
npm package: @jobscale/core
Description: @jobscale/core
Author: jobscale
Latest version: 0.2.4

# @jobscale/core

## Installation

```
npm i @jobscale/core
```

## Examples

### logger

```javascript
require('@jobscale/core');

logger.info({ timestamp: Date.now() });
```

### fetch

```javascript
require('@jobscale/core');

fetch('https://inet-ip.info/ip')
.then(res => res.text())
.then(ip => logger.info({ ip }));
```

### spawn

```javascript
require('@jobscale/core');

const ping = ip => {
  const params = ['-c', '2', '-i', '1', ip];
  return spawn('ping', params);
};

ping('127.0.0.1')
.then(result => logger.info({ result }));
```

## ESLint settings

.eslintrc.js
```javascript
{
  globals: {
    logger: 'readonly',
    spawn: 'readonly',
    fetch: 'readonly',
  },
}
```

## Jest test
```
docker run --rm -p 127.0.0.1:3128:3128 -d ghcr.io/jobscale/squid
npm test
```
npm package: @jobscale/create-logger
Description: create-logger
Latest version: 0.2.2

# @jobscale/create-logger

## Description

***log level and priority***

|level|priority|color|default|
|:-:|:-:|:-:|:-:|
|error|0|red||
|warn|1|yellow||
|info|2|white|✓|
|debug|3|white||
|verbose|4|white||

## Installation

```
npm i @jobscale/create-logger
```

## Examples

### logging (ES Module)

```javascript
import { createLogger } from '@jobscale/create-logger';

const logger = createLogger('info');
logger.error('error', { timestamp: Date.now() });
logger.warn('warn', { timestamp: Date.now() });
logger.info('info', { timestamp: Date.now() });
logger.debug('debug', { timestamp: Date.now() });
logger.verbose('verbose', { timestamp: Date.now() });
```

### test

```bash
npm test
```
npm package: @jobscale/csv
Description: csv.stringify csv.parse @jobscale/csv
Author: jobscale
Latest version: 1.5.4

# @jobscale/csv

### csv.stringify

`@param [[]]`

### csv.parse

`@param string`

#### Installation

```bash
npm i @jobscale/csv
```

## Testing

```
npm test
```

#### Browser Examples

csv.js

```javascript
import { csv } from 'https://esm.sh/@jobscale/csv';

const logger = console;
const main = () => {
  csv.stringify([['a', 1, 2, 3, 4]])
  .then(logger.info);
  csv.parse('a,1,2,3,4')
  .then(logger.info);
};
main();
```

#### Nodejs [ 20.x, 22.x, 24.x ] Examples

csv.js

```javascript
import { csv } from '@jobscale/csv';

const logger = console;
const main = () => {
  csv.stringify([['a', 1, 2, 3, 4]])
  .then(logger.info);
  csv.parse('a,1,2,3,4')
  .then(logger.info);
};
main();
```
npm package: @jobscale/eslint-plugin-standard
Description: eslint plugin standard
Author: jobscale
Latest version: 0.0.14

# ESLint Plugin Standard

## ESLint v9

### Install

```
npm i -D @jobscale/eslint-plugin-standard
```

### eslint.config.js

```
import standard from '@jobscale/eslint-plugin-standard';

export default [
  standard.configs.standard,
];
```

## Docker Examples

```
  docker pull jobscale/eslint-plugin-standard
```

### Build

```
docker build . -t jobscale/eslint-plugin-standard
```

### lint

```
docker run --rm -v $(pwd):/home/node/task -it jobscale/eslint-plugin-standard
```

### lint fix

```
docker run --rm -v $(pwd):/home/node/task -it jobscale/eslint-plugin-standard npm run lint -- --fix
```
npm package: @jobscale/fetch
Description: @jobscale/fetch
Author: jobscale
Latest version: 0.4.0

# @jobscale/fetch

Same as 'axios'

See: `https://www.npmjs.com/package/axios`

## Installation

```
npm i @jobscale/fetch
```

## Jest test
```
docker run --rm -p 127.0.0.1:3128:3128 -d ghcr.io/jobscale/squid
npm test
```

## Examples

- test.js

```javascript
import fetch '@jobscale/fetch';

const logger = console;
const main = async () => {
  logger.info([
    { ip: await fetch('https://inet-ip.info/ip').then(res => res.data) },
    { ip: await fetch('https://inet-ip.info/ip', { 'user-agent': 'fetch' }).then(res => res.data) },
    { ip: await fetch('https://inet-ip.info/ip', { method: 'post', 'user-agent': 'fetch' }).then(res => res.data) },
    { ip: await fetch({ url: 'https://inet-ip.info/ip', method: 'post', 'user-agent': 'fetch' }).then(res => res.data) },
    await fetch({ url: 'https://inet-ip.info/json', method: 'post', 'user-agent': 'fetch' }).then(res => res.data),
  ]);
};
main();
```

### run

```
https_proxy='http://127.0.0.1:3128' node test.js
```
npm package: @jobscale/hash-pbkdf2
Description: ## installation
Latest version: 0.0.3

# @jobscale/hash-pbkdf2

## installation

```
npm i @jobscale/hash-pbkdf2
```

## examples

```
const { Auth: Pbkdf2 } = require('@jobscale/hash-pbkdf2');

const logger = console;
const auth = new Pbkdf2();
const hash = auth.hash('it password', 'salt of cake');
logger.info({ hash });
```

## lint

```
npm run lint
```

## test

```
npm test
```
npm package: @jobscale/logger
Description: @jobscale/logger
Author: jobscale
Latest version: 0.10.5

# @jobscale/logger

## Options

### logLevel

0  'error',
1  'warn',
2  'info',
3  'debug',
4  'trace',

default 'info'

## Installation

```
npm i @jobscale/logger
```

## Nodejs Examples

```javascript
import { Logger, logger, createLogger } from '@jobscale/logger';

logger.info('hello 01', Date.now());

const logger2 = new Logger({ logLevel: 'info', timestamp: true });
logger2.info('hello 02', Date.now());

const logger3 = createLogger('info', { timestamp: true });
logger3.info('hello 03', Date.now());
```

## Using Browser

- ES Module Browser
```html
<script type="module">
import { Logger, logger, createLogger } from 'https://esm.sh/@jobscale/logger';

logger.info('hello 01', Date.now());

const logger2 = new Logger({ logLevel: 'info', timestamp: true });
logger2.info('hello 02', Date.now());

const logger3 = createLogger('info', { timestamp: true });
logger3.info('hello 03', Date.now());
</script>
```
npm package: @jobscale/shell
Description: shell exec spawn
Author: jobscale
Latest version: 0.0.1

## install

```
npm i -S jobscale/shell
```

## example

```
const { Shell } = require('shell');

const main = () => {
  new Shell().spawn('curl', ['ifconfig.io'])
  .then(() => logger.info(text));
};
(() => {
  main();
})();
```
npm package: @jobscale/slack
Description: @jobscale/slack
Author: jobscale
Latest version: 0.3.2

# @jobscale/slack

## install

```
npm i @jobscale/slack
```

## examples

### send slack channel

```
import fs from 'fs';
import { logger } from '@jobscale/logger';
import { Slack } from '@jobscale/slack';

const env = JSON.parse(fs.readFileSync('test/env.json').toString());

describe('test slack send', () => {
  it('toStrictEqual prompt', () => {
    const params = { text: 'jest test send' };
    return new Slack(env).send(params)
    .then(res => {
      const prompt = { status: 200, statusText: 'OK', body: 'ok' };
      logger.info(res);
      expect(res).toStrictEqual(prompt);
    });
  });
});
```

### clear slack channel

```
import fs from 'fs';
import { logger } from '@jobscale/logger';
import { Slack } from '@jobscale/slack';

const env = JSON.parse(fs.readFileSync('test/env.json').toString());

describe('test slack clear channel', () => {
  it('toBe prompt', () => {
    const prompt = 1;
    return new Slack(env).clearChannel(prompt)
    .then(res => {
      logger.info(res);
      expect(res.deleted).toBe(prompt);
    });
  });
});
```
npm package: @jobscale/totp
Description: Time-based One-Time Password @jobscale/totp
Latest version: 0.3.6

# totp

## Installation

```
npm i @jobscale/totp
```

## Examples

```
import { Totp } from '@jobscale/totp';
// const { Totp } = await import('@jobscale/totp'); // CommonJs

const list = [
  'JSXJPX6EY4BMPXI',
  'JSXJPX6EY4BMPXIRS',
  'JSXJPX6EY4BMPXIRSSR',
  'JSXJPX6EY4BMPXIRSSR74',
];

describe('test base32', () => {
  for (const [index, value] of list.entries()) {
    describe(`test step ${index}`, () => {
      it(`toBe step prompt window ${index}`, async () => {
        const totp = new Totp();
        const code = await totp.auth({
          secret: value,
        });
        const res = await totp.verify({
          code,
          secret: value,
          window: 1,
        });
        expect(res).toBe(true);
      });

      it(`toBe step 1 window ${index}`, async () => {
        const totp = new Totp();
        const code = await totp.auth({
          secret: value,
          time: Math.floor(Date.now() / 1000) + 30,
        });
        const res = await totp.verify({
          code,
          secret: value,
          window: 1,
        });
        expect(res).toBe(true);
      });

      it(`toBe step 2 window ${index}`, async () => {
        const totp = new Totp();
        const code = await totp.auth({
          secret: value,
          time: Math.floor(Date.now() / 1000) + 60,
        });
        const res = await totp.verify({
          code,
          secret: value,
          window: 2,
        });
        expect(res).toBe(true);
      });

      it(`toBe step 3 window ${index}`, async () => {
        const totp = new Totp();
        const code = await totp.auth({
          secret: value,
          time: Math.floor(Date.now() / 1000) + 90,
        });
        const res = await totp.verify({
          code,
          secret: value,
          window: 3,
        });
        expect(res).toBe(true);
      });
    });
  }
});
```

## Demo

[https://totp.cdn.jsx.jp](https://totp.cdn.jsx.jp)

## Lint

```
npm run lint --if-present
```

## Test

```
npm test
```
npm package: @jobscale/uuid
Description: @jobscale/uuid
Author: jobscale
Latest version: 0.2.3

# @jobscale/uuid

## Installation

```
npm i @jobscale/uuid
```

## Examples

```javascript
import { Logger } from '@jobscale/logger';
import { uuid } from '@jobscale/uuid';
// const { uuid } = await import('@jobscale/uuid); // CommonJs

const logger = new Logger({ logLevel: 'info' });
logger.info({ uuid: uuid() });
```
npm package: @jobscale/yaml-js
Description: yaml json convertor
Author: jobscale
Latest version: 0.0.5

# @jobscale/yaml-js

YAML JSON Convertor

## Installation
```
npm i -g @jobscale/yaml-js
```

## Examples

### YAML to JSON
```
yaml2json test/sample.yaml
```

### JSON to YAML
```
json2yaml test/sample.json
```

<hr>

# js-yaml

## Examples

```
# show version
js-yaml -v
js-yaml --version

# show help
js-yaml -h
js-yaml --help

# yaml to json
js-yaml test/sample.yaml

# json to yaml
js-yaml test/sample.json

# yaml to json
js-yaml < test/sample.yaml

# json to yaml
js-yaml < test/sample.json
```
npm package: @jobsimi/apm
Description: APM(Agent Package Manager) CLI and library
Author: jobsimi
Latest version: 0.1.6

APM(Agent Package Manager) CLI and library

## Install as CLI

```sh
pnpm add -g @fynal/apm
```

```sh
apm --help
```

## Program Usage

```js
import { APMAgent } from '@fynal/apm';

class Agent {
	constructor() {
		this.apmAgent = new APMAgent();
	}
	async run(params, saveconfig) {
		const output = {
			text: 'text',
		};

		this.apmAgent.save_output(saveconfig, output); // save output

		return output;
	}
}
```

## Dev

1. change code in `src` directory
2. change version in `package.json`
3. publish to npm
   ```sh
   pnpm run pub
   ```
npm package: @jobstate/core
Description: Core helpers for normalizing job lifecycle state.
Author: Trevor Zitting
Latest version: 0.1.0

# @jobstate/core

Core helpers for normalizing job lifecycle state.

## Install

```bash
npm install @jobstate/core
```

## Usage

```js
const {
  normalizeJobState,
  isTerminalState,
  compareStateProgress
} = require("@jobstate/core");

normalizeJobState("RUNNING"); // "running"
isTerminalState("completed"); // true
compareStateProgress("queued", "running"); // -1
```

## API

- `normalizeJobState(input)`: returns one of `queued | running | completed | failed | canceled`.
- `isTerminalState(input)`: `true` for `completed`, `failed`, or `canceled`.
- `compareStateProgress(a, b)`: negative if `a` is earlier, positive if later, `0` if equivalent.