open-index/open-npm huggingface dataset:
npm package: @node-kit/extra.path
Description: Some shared extra utilities for nodejs build-in path modules
Author: saqqdy
Latest version: 3.3.1

<div style="text-align: center;" align="center">

# @node-kit/extra.path

Some shared extra utilities for nodejs build-in path modules

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/extra.path

# use yarn
$ yarn add -D @node-kit/extra.path

# use npm
$ npm install -D @node-kit/extra.path
```

## Usage

use import

```js
import { dirname } from '@node-kit/extra.path'

dirname()
```

use require

```js
const { dirname } = require('@node-kit/extra.path')

dirname()
```

## API reference

### 1. dirname

get dirname from path

- Usage: `dirname(path)`
- Parameters:

<div class="table-prop">

| Param | Description | Type     | Optional value | Required | Default value |
| ----- | ----------- | -------- | -------------- | -------- | ------------- |
| path  | simple path | `string` | -              | `true`   | -             |

</div>

- Types:

```ts
declare function dirname(path: string): string
```

- Demos:

1. simple use

```ts
import { dirname } from '@node-kit/extra.path'

const data = dirname('/path/of/dir/saqqdy')
// data => saqqdy
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/extra.path.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/extra.path
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/extra.path/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/extra.path&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/extra.path.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/extra.path?branch=master
[download-image]: https://img.shields.io/npm/dm/@node-kit/extra.path.svg?style=flat-square
[download-url]: https://npmjs.org/package/@node-kit/extra.path
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/pm-info
Description: A simple utility to get the package manager information which used in the project
Author: saqqdy
Latest version: 1.3.4
Deprecated: This package has been deprecated and is no longer maintained. Please use pm-info.

<div style="text-align: center;" align="center">

# @node-kit/pm-info

A simple utility to get the package manager information which used in the project

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/pm-info

# use yarn
$ yarn add -D @node-kit/pm-info

# use npm
$ npm install -D @node-kit/pm-info
```

## Usage

1. use `@node-kit/pm-info` in async mode
   s

```js
import { pmInfo } from '@node-kit/pm-info'

pmInfo().then(info => {
  console.log('The package manager is: ', info) // { name: 'pnpm', version: '7.25.0' } | null
})
```

2. use `@node-kit/pm-info` in sync mode

```js
import { pmInfoSync } from '@node-kit/pm-info'

console.log('The package manager is: ', pmInfoSync()) // { name: 'pnpm', version: '7.25.0' } | null
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/pm-info.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/pm-info
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/pm-info/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/pm-info&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/pm-info.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/pm-info?branch=master
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/pnpm-workspace-root
Description: A simple utility to get the pnpm workspace root
Author: saqqdy
Latest version: 3.3.1

<div style="text-align: center;" align="center">

# @node-kit/pnpm-workspace-root

A simple utility to get the pnpm workspace root

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/pnpm-workspace-root

# use yarn
$ yarn add -D @node-kit/pnpm-workspace-root

# use npm
$ npm install -D @node-kit/pnpm-workspace-root
```

## Usage

use import

```js
import { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } from '@node-kit/pnpm-workspace-root'

pnpmWorkspaceRoot()
// or
pnpmWorkspaceRootSync()
```

use require

```js
const { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } = require('@node-kit/pnpm-workspace-root')

pnpmWorkspaceRoot()
// or
pnpmWorkspaceRootSync()
```

## API reference

- Usage: `pnpmWorkspaceRoot(cwd)` & `pnpmWorkspaceRootSync(cwd)`
- Parameters:

<div class="table-prop">

| Param | Description  | Type     | Optional value | Required | Default value |
| ----- | ------------ | -------- | -------------- | -------- | ------------- |
| cwd   | running path | `string` | -              | `false`  | -             |

</div>

- Types:

```ts
declare function pnpmWorkspaceRoot(cwd?: string): Promise<string | null>

declare function pnpmWorkspaceRootSync(cwd?: string): string | null
```

- Demos:

1. simple use

```ts
import { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } from '@node-kit/pnpm-workspace-root'

pnpmWorkspaceRoot().then(path => {
  console.log('The pnpm workspace root is: ', path) // /Users/user/path/of/package/root or null
})
console.log('The pnpm workspace root is: ', pnpmWorkspaceRootSync()) // /Users/user/path/of/package/root or null
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/pnpm-workspace-root.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/pnpm-workspace-root
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/pnpm-workspace-root/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/pnpm-workspace-root&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/pnpm-workspace-root.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/pnpm-workspace-root?branch=master
[download-image]: https://img.shields.io/npm/dm/@node-kit/pnpm-workspace-root.svg?style=flat-square
[download-url]: https://npmjs.org/package/@node-kit/pnpm-workspace-root
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/utils
Description: Some shared utilities
Author: saqqdy
Latest version: 3.3.1

<div style="text-align: center;" align="center">

# @node-kit/utils

Some shared utilities

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/utils

# use yarn
$ yarn add -D @node-kit/utils

# use npm
$ npm install -D @node-kit/utils
```

## Usage

```js
import { functionName } from '@node-kit/utils'

// run functionName
functionName()
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/utils.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/utils
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/utils/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/utils&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/utils.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/utils?branch=master
[download-image]: https://img.shields.io/npm/dm/@node-kit/utils.svg?style=flat-square
[download-url]: https://npmjs.org/package/@node-kit/utils
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/which-pm
Description: A simple utility to get which package manager used in the project
Author: saqqdy
Latest version: 3.3.1

<div style="text-align: center;" align="center">

# @node-kit/which-pm

A simple utility to get which package manager used in the project

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/which-pm

# use yarn
$ yarn add -D @node-kit/which-pm

# use npm
$ npm install -D @node-kit/which-pm
```

## Usage

use `@node-kit/which-pm` in terminal

```bash
npx which-pm

# output: pnpm@7.26.1 | null
```

use import

```js
import { whichPM, whichPMSync } from '@node-kit/which-pm'

whichPM()
// or
whichPMSync()
```

use require

```js
const { whichPM, whichPMSync } = require('@node-kit/which-pm')

whichPM()
// or
whichPMSync()
```

## API reference

- Usage: `whichPM([cwd, withVersion])` & `whichPMSync([cwd, withVersion])`
- Parameters:

<div class="table-prop">

| Param       | Description         | Type      | Optional value | Required | Default value |
| ----------- | ------------------- | --------- | -------------- | -------- | ------------- |
| cwd         | running path        | `string`  | -              | `false`  | -             |
| withVersion | return with version | `boolean` | -              | `false`  | `true`        |

</div>

- Types:

```ts
declare function whichPM(cwd?: string, withVersion?: boolean): Promise<string | null>

declare function whichPMSync(cwd?: string, withVersion?: boolean): string | null
```

- Demos:

1. simple use

```ts
import { whichPM, whichPMSync } from '@node-kit/which-pm'

whichPM().then(path => {
  console.log('The package manager is: ', path) // pnpm@7.26.1 | null
})

console.log('The package manager is: ', whichPMSync()) // pnpm@7.26.1 | null
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/which-pm.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/which-pm
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/which-pm/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/which-pm&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/which-pm.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/which-pm?branch=master
[download-image]: https://img.shields.io/npm/dm/@node-kit/which-pm.svg?style=flat-square
[download-url]: https://npmjs.org/package/@node-kit/which-pm
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/workspace-info
Description: A simple utility to get the workspace information
Author: saqqdy
Latest version: 3.3.1

<div style="text-align: center;" align="center">

# @node-kit/workspace-info

A simple utility to get the workspace information

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/workspace-info

# use yarn
$ yarn add -D @node-kit/workspace-info

# use npm
$ npm install -D @node-kit/workspace-info
```

## Usage

use import

```js
import { workspaceInfo, workspaceInfoSync } from '@node-kit/workspace-info'

workspaceInfo()
// or
workspaceInfoSync()
```

use require

```js
const { workspaceInfo, workspaceInfoSync } = require('@node-kit/workspace-info')

workspaceInfo()
// or
workspaceInfoSync()
```

## API reference

- Usage: `workspaceInfo(cwd)` & `workspaceInfoSync(cwd)`
- Parameters:

<div class="table-prop">

| Param | Description  | Type     | Optional value | Required | Default value |
| ----- | ------------ | -------- | -------------- | -------- | ------------- |
| cwd   | running path | `string` | -              | `false`  | -             |

</div>

- Types:

```ts
declare type WorkspaceInfo = Record<
  string,
  {
    path: string
  }
>

declare function workspaceInfo(cwd?: string): Promise<WorkspaceInfo | null>

declare function workspaceInfoSync(cwd?: string): WorkspaceInfo | null
```

- Demos:

1. simple use

```ts
import { workspaceInfo, workspaceInfoSync } from '@node-kit/workspace-info'

workspaceInfo({
  cwd,
  packageManager: 'pnpm'
}).then(path => {
  console.log('The workspace info is: ', path) // { projectA: { path: 'packages/projectA' } }
})

console.log('The workspace info is: ', workspaceInfoSync()) // { projectA: { path: 'packages/projectA' } }
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/workspace-info.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/workspace-info
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/workspace-info/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/workspace-info&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/workspace-info.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/workspace-info?branch=master
[download-image]: https://img.shields.io/npm/dm/@node-kit/workspace-info.svg?style=flat-square
[download-url]: https://npmjs.org/package/@node-kit/workspace-info
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-kit/workspace-root
Description: A simple utility to get the workspace root
Author: saqqdy
Latest version: 1.3.4
Deprecated: This package has been deprecated and is no longer maintained. Please use workspace-root.

<div style="text-align: center;" align="center">

# @node-kit/workspace-root

A simple utility to get the workspace root

[![NPM version][npm-image]][npm-url]
[![Codacy Badge][codacy-image]][codacy-url]
[![Test coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]

[![Sonar][sonar-image]][sonar-url]

</div>

## Install

```bash
# use pnpm
$ pnpm install -D @node-kit/workspace-root

# use yarn
$ yarn add -D @node-kit/workspace-root

# use npm
$ npm install -D @node-kit/workspace-root
```

## Usage

1. use `@node-kit/workspace-root` in async mode

```js
import { workspaceRoot } from '@node-kit/workspace-root'

workspaceRoot().then(path => {
  console.log('The workspace root is: ', path) // /Users/user/path/of/package/root or null
})
```

2. use `@node-kit/workspace-root` in sync mode

```js
import { workspaceRootSync } from '@node-kit/workspace-root'

console.log('The workspace root is: ', workspaceRootSync()) // /Users/user/path/of/package/root or null
```

## Issues & Support

Please open an issue [here](https://github.com/saqqdy/node-kit/issues).

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@node-kit/workspace-root.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@node-kit/workspace-root
[codacy-image]: https://app.codacy.com/project/badge/Grade/f70d4880e4ad4f40aa970eb9ee9d0696
[codacy-url]: https://www.codacy.com/gh/saqqdy/@node-kit/workspace-root/dashboard?utm_source=github.com&utm_medium=referral&utm_content=saqqdy/@node-kit/workspace-root&utm_campaign=Badge_Grade
[codecov-image]: https://img.shields.io/codecov/c/github/saqqdy/@node-kit/workspace-root.svg?style=flat-square
[codecov-url]: https://codecov.io/github/saqqdy/@node-kit/workspace-root?branch=master
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[sonar-image]: https://sonarcloud.io/api/project_badges/quality_gate?project=saqqdy_node-kit
[sonar-url]: https://sonarcloud.io/dashboard?id=saqqdy_node-kit
npm package: @node-lambdas/client
Description: A browser/Node.js client for Node Lambdas -- https://jsfn.run/
Author: Darlan Alves
Latest version: 1.0.5

# Node Lambdas Client

Node/web interface to use with [jsfn.run](https://jsfn.run) API.

## Usage

Here's an example on how to convert between JSON to YAML and then base64 using a web function:

```js
// JSON > YAML > base64
const json = JSON.stringify({ hello: 'world' });
const encode = pipe({ name: 'yaml', action: 'encode' }, { name: 'base64', action: 'encode' });
const response = await encode(json);

console.log(await response.text());
```
npm package: @node-lib-tech/universal-test-cases-gen
Description: Universal library to auto-generate test cases for Node, React, Angular, Vue, and NestJS using Jest, Mocha, Vitest, Supertest, or Playwright.
Author: @node-lib-tech
Latest version: 1.1.18


# @react-lib-tech/universal-test-cases-gen

[![npm version](https://img.shields.io/npm/v/@react-lib-tech/universal-test-cases-gen.svg)](https://www.npmjs.com/package/@react-lib-tech/universal-test-cases-gen)
[![npm downloads](https://img.shields.io/npm/dm/@react-lib-tech/universal-test-cases-gen.svg)](https://www.npmjs.com/package/@react-lib-tech/universal-test-cases-gen)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

🚀 A universal **test case generator** for **Node.js, React, Angular, Vue, and NestJS**.  
Supports **Jest, Mocha, and Vitest**.  
Works as both a **CLI tool** and a **library**.

👉 **Download README.md**

---

## ✨ Features

- 🔎 Automatically scans project folders  
- 🧪 Generates test stubs for:
  - Node.js functions & classes  
  - React components  
  - Angular / Vue / NestJS files  
- 📦 Supports:
  - Jest
  - Mocha + Chai
  - Vitest
- 📂 Creates `.test.ts` files inside `__tests__/` (or custom folder)  
- 📊 Optional JSON output report  
- ⚡ Zero configuration required for most projects

---

## 📦 Installation

### Install Globally (CLI Usage)

```sh
npm install -g @react-lib-tech/universal-test-cases-gen
```

### Install as Dev Dependency (Library Usage)

```sh
npm install --save-dev @react-lib-tech/universal-test-cases-gen
```

---

## 🚀 CLI Usage

```sh
universal-test-cases-gen \
  --root ./src \
  --framework react \
  --testFramework jest \
  --output __tests__ \
  --reportJson
```

### Available Options

| Flag | Description | Default |
|------|-------------|---------|
| `--root` | Root folder to scan | `./src` |
| `--framework` | node / react / angular / vue / nestjs | `node` |
| `--testFramework` | jest / mocha / vitest | `jest` |
| `--output` | Where test files are written | `__tests__` |
| `--reportJson` | Return a JSON report | `false` |

---

## 📖 Library Usage (Node.js / TypeScript)

Use `generateTests()` inside your app, script, or build pipeline.

```ts
import {
  generateTests,
  type TestGenConfig,
  type GeneratedTestReport
} from "@react-lib-tech/universal-test-cases-gen";

const config: TestGenConfig = {
  rootFolder: "./src",
  framework: "react",
  testFramework: "jest",
  output: "__tests__",
  reportJson: true
};

(async () => {
  const report: GeneratedTestReport[] = await generateTests(config);
  console.log("📑 Generated Test Report:", report);
})();
```

---

## 📊 Example Output JSON

```json
[
  {
    "file": "src/components/Button.tsx",
    "exports": ["Button"],
    "testFile": "__tests__/Button.test.ts"
  },
  {
    "file": "src/utils/math.ts",
    "exports": ["add", "subtract"],
    "testFile": "__tests__/math.test.ts"
  }
]
```

---

## 📜 License

MIT © 2025 – @react-lib-tech
npm package: @node-libraries/dynamic-import
Description: Avoid malfunction of DynamicImport on `ts-node` and call ES Modules from CommonJS
Author: SoraKumo
Latest version: 1.0.6

# @node-libraries/dynamic-import

Avoid malfunction of DynamicImport on `ts-node` and call ES Modules from CommonJS

## usage

```typescript
import {dynamicImport} from "@node-libraries/dynamic-import";

const async main() => {
  const { func } = await dynamicImport("any-package");
}
```
npm package: @node-libraries/promise-limit
Description: Limits the maximum number of asynchronous processes that can be executed
Author: SoraKumo
Latest version: 1.0.5

# @node-libraries/promise-limit

[![](https://img.shields.io/npm/l/@node-libraries/promise-limit)](https://www.npmjs.com/package/@node-libraries/promise-limit)
[![](https://img.shields.io/npm/v/@node-libraries/promise-limit)](https://www.npmjs.com/package/@node-libraries/promise-limit)
[![](https://img.shields.io/npm/dw/@node-libraries/promise-limit)](https://www.npmjs.com/package/@node-libraries/promise-limit)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SoraKumo001/promise-parallels)

Limits the maximum number of asynchronous processes that can be executed.  
The number of executions is controlled at the loop stage, so no memory is wasted in the queue.

## usage

- `promiseLimit()` to create an instance
- `add()` to store Promise
- `wait()` waits for a specified maximum number
- `all()` waits for remaining processes

```ts
import { promiseLimit } from '@node-libraries/promise-limit';
const main = async () => {
  const ps = promiseLimit();
  for (let i = 0; i < 10; i++) {
    // Execute a random exit process and save the Promise
    ps.add(new Promise((resolve) => setTimeout(() => resolve(i), Math.random() * 100)));
    // Specify the maximum number of parallel execution and wait
    // Return value false: the process has not finished within the limit
    // Return index of the process returned by resolve
    const v = await ps.wait(5);
    console.log(`${i}:${v}`); // Number of loops: display the finished function
  }
  // wait for remaining processing if the loop exits with less than 5 in parallel
  (await ps.all()).forEach((v) => console.log(`*:${v}`));
};

main();
```

## Execution result

```sh
0:false
1:false
2:false
3:false
4:3
5:1
6:2
7:4
8:0
9:6
*:5
*:7
*:8
*:9
```
npm package: @node-libraries/scaffold
Description: Create a canned file based on a template
Author: SoraKumo
Latest version: 1.0.5

# @node-libraries/scaffold

## install

`npm -g install @node-libraries/scaffold`

## description

Create a canned file based on a template.  
Templates can also be placed on github.

## usage

```
Usage: scaffold [options] [command]

Options:
  -V, --version            output the version number
  -h, --help               display help for command

Commands:
  create [options] <name>  Create component
      -t, --templatePath <templatePath>  TemplatePath or GitHub-Url(default:./templates)
      -o, --outputPath <outputPath>      OutputPath (default:./src/components)
  help
```

Remote commands refer to the value of `supabase/.env.remote`

## Template Example(Example of using React and Storybook)

- The extension must be `.template`.  
  extension to prevent automatic formatting by the editor.
- The following strings will be replaced  
  `{{{NAME}}}` -> ComponentName  
  `{{{PATH}}}` -> ComponentPath

### File Examples

<https://github.com/node-libraries/scaffold/tree/master/templates>

- templates/index.ts.template

```tsx
export * from "./{{{NAME}}}";
```

- templates/{{{NAME}}}.module.scss.template

```tsx
.root {
}
```

- templates/{{{NAME}}}.tsx.template

```tsx
import React, { FC } from 'react';
import styled from './{{{NAME}}}.module.scss';

interface Props {}

/**
 * {{{NAME}}}
 *
 * @param {Props} { }
 */
export const {{{NAME}}}: FC<Props> = ({}) => {
  return <div className={styled.root}>Test</div>
};
```

- templates/{{{NAME}}}.stories.tsx.template

```tsx
import { expect } from "@storybook/jest";
import { within } from "@storybook/testing-library";
import { ComponentMeta, ComponentStoryObj } from '@storybook/react';
import { {{{NAME}}} } from './{{{NAME}}}';

const meta: ComponentMeta<typeof {{{NAME}}}> = {
  title: 'Components/{{{PATH}}}{{{NAME}}}',
  component: {{{NAME}}},
  parameters: {
    //  nextRouter: { asPath: '/' },
  },
  args: {},
};
export default meta;

export const Primary: ComponentStoryObj<typeof {{{NAME}}}> = {
  args: {},
  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement);
    expect(
      canvas.getByText('Test')
    ).toBeInTheDocument();
  },
}
```

## Command Usage

- templates -> src/components/Sample01

```sh
scaffold create Sample01
```

- templates -> src/components/Samples/Sample01

```sh
scaffold create Samples/Sample01
```

- template -> src/component/Samples/Sample01

```sh
scaffold create -t template -o src/component Samples/Sample01
```

- GitHub -> src/component/Samples/Sample01

```sh
scaffold create -t https://github.com/node-libraries/scaffold/tree/master/templates/storybook8 -o src/component Samples/Sample01
```
npm package: @node-libraries/semaphore
Description: Implement virtual semaphore for asynchronous processing
Author: SoraKumo
Latest version: 1.0.3

# @node-libraries/semaphore

Implement virtual semaphore for asynchronous processing

## usage

```ts
// Importing packages
import { semaphore } from "@node-libraries/semaphore";
// Instance Creation
const s = semaphore();
// Synchronization Lock
await s.acquire();
// Synchronization lock release
s.release();
// Wait until all locks are unlocked.
await s.all();
```

```ts
// Specify maximum number of parallels
const s = semaphore(5);
```

## example

```ts
import { semaphore } from "@node-libraries/semaphore";

const f = (value: string) =>
  new Promise<void>((resolve) => {
    console.timeLog("debug", value);
    setTimeout(resolve, 1000);
  });

const main = async () => {
  console.time("debug");
  const s = semaphore();
  ["A", "B", "C", "D", "E"].forEach(async (v) => {
    await s.acquire();
    await f(v);
    s.release();
  });
  await s.all(); // Wait for everything to be finished.
  console.timeLog("debug", "end");
};
main();

/* Result
debug: 0.197ms A
debug: 1.014s B
debug: 2.027s C
debug: 3.039s D
debug: 4.040s E
debug: 5.050s end
*/
```

```ts
import { semaphore } from "@node-libraries/semaphore";

const f = (value: string) =>
  new Promise<void>((resolve) => {
    console.timeLog("debug", value);
    setTimeout(resolve, 1000);
  });

const main = async () => {
  console.time("debug");
  const s = semaphore(2);
  ["A", "B", "C", "D", "E"].forEach(async (v) => {
    await s.acquire();
    await f(v);
    s.release();
  });
  await s.all(); // Wait for everything to be finished.
  console.timeLog("debug", "end");
};
main();

/* Result
debug: 0.19ms A
debug: 1.826ms B
debug: 1.005s C
debug: 1.005s D
debug: 2.012s E
debug: 3.028s end
*/
```
npm package: @node-libraries/wasm-avif-encoder
Description: WebAssembly avif encoder with WebWorker support.
Author: SoraKumo
Latest version: 1.0.2

# @node-libraries/wasm-avif-encoder

# Overview

Provides the ability to encode WebP using WebAssembly and WebWorker.

Remix(esbuild) and Next.js(webpack) are supported.

# types

```ts
encode(params:{data: BufferSource, width: number, height: number, quality?: number}): Promise<Uint8Array | null>
```

```ts
encode(params:{data: ImageData, quality?: number}): Promise<Uint8Array | null>
```

# usage

```ts
import { encode } from '@node-libraries/wasm-avif-encoder';

// Next.js(webpack)
const encodedValue = await encode({ data: ctx.getImageData(0, 0, img.width, img.height) });
const encodedValue2 = await encode({ data: arrayBuffer, width, height });

// Remix(esbuild)
// Files need to be installed manually
// node_modules/@node-libraries/wasm-webp-encoder/dist  =>
//   public/avif/worker.js
//   public/avif/avif.js
//   public/avif/avif.wasm
const encodedValue3 = await encode({ data: arrayBuffer, width, height, worker: '/avif/worker.js' });
```

# Sample when used with Next.js

- https://github.com/SoraKumo001/next-webp
npm package: @node-libraries/wasm-webp-encoder
Description: WebAssembly webp encoder with WebWorker support.
Author: SoraKumo
Latest version: 1.1.1

# @node-libraries/wasm-webp-encoder

# Overview

Provides the ability to encode WebP using WebAssembly and WebWorker.

Remix(esbuild) and Next.js(webpack) are supported.

# types

```ts
encode(params:{data: BufferSource, width: number, height: number, quality?: number}): Promise<Uint8Array | null>
```

```ts
encode(params:{data: ImageData, quality?: number}): Promise<Uint8Array | null>
```

# usage

```ts
import { encode } from '@node-libraries/wasm-webp-encoder';

// Next.js(webpack)
const encodedValue = await encode({ data: ctx.getImageData(0, 0, img.width, img.height) });
const encodedValue2 = await encode({ data: arrayBuffer, width, height });

// Remix(esbuild)
// Files need to be installed manually
// node_modules/@node-libraries/wasm-webp-encoder/dist  =>
//   public/webp/worker.js
//   public/webp/webp.js
//   public/webp/webp.wasm
const encodedValue3 = await encode({ data: arrayBuffer, width, height, worker: '/webp/worker.js' });
```

# Sample when used with Next.js

- https://github.com/SoraKumo001/next-webp
npm package: @node-lightning/bitcoind
Description: Basic bitcoind JSONRPC and ZMQ client
Author: Brian Mancini
Latest version: 0.28.0

# @node-lightning/bitcoind

This package provides connectivity to a bitcoind node by enabling RPC functions
and Zeromq streaming.

This package has an external dependency on the
[zeromq](https://www.npmjs.com/package/zeromq) package.

## Example Usage

You can connect to a bitcoind instance by providing rpc and zeromq options.

```typescript
const bitciondOptions = {
  host: "127.0.0.1",
  port: 8333,
  rpcuser: "user",
  rpcpassword: "pass",
  zmqpubrawtx: "tcp://127.0.0.1:18332"
  zmqpubrawblock: "tcp://127.0.0.1:18333";
}
const client = new BitcoindClient(bitcoindOptions);
```

You can subscribe to raw transactions and blocks emitted by zeromq:

```typescript
client.subscribeRawTx();
client.on("rawtx", (rawtx: Buffer) => {
    // deserialize and do something
});
```

```typescript
client.subscribeRawBlock();
client.on("rawblock", (rawblock: Buffer) => {
    // deserialize and do something
});
```

You can call RPC functions:

```typescript
// blockchain info
await client.getBlockchainInfo();

// returns the block hash for a height
await client.getBlockHash(0);

// returns a BlockSummary
await client.getBlock("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");

// returns a Buffer
await client.getRawBlock("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");

// returns a Transaction
await client.getTransaction("aa5f3068b53941915d82be382f2b35711305ec7d454a34ca69f8897510db7ab8");

// returns a Buffer
await client.getRawTransaction("aa5f3068b53941915d82be382f2b35711305ec7d454a34ca69f8897510db7ab8");

// returns a Utxo
await client.getUtxo("aa5f3068b53941915d82be382f2b35711305ec7d454a34ca69f8897510db7ab8", 0);
```
npm package: @node-lightning/checksum
Description: Checksum library with CRC32C
Author: Brian Mancini
Latest version: 0.28.0

# `@node-lightning/checksum`

Calculates a CRC32C checksum based on RFC3720.

## Usage

```
const { crc32c } = require('@node-lightning/checksum');
const checksum = crc32c(Buffer.from("hello")); // 2591144780
```
npm package: @node-lightning/crypto
Description: Crypto suite for Node-Lightning
Author: Brian Mancini
Latest version: 0.28.0

# @node-lightning/crypto

This packages uses the native Node.js crypto for all functionality except secp256k1. This package requires Node.js 10.17+.

This package provides cryptographic functions for use in LN Tools:

-   sha256
-   hash160
-   hkdf
-   secp256k1 ECDH
-   secp256k1 private key generation
-   secp256k1 public key derivation
-   chacha20-poly1305 AEAD
npm package: @node-lightning/graph
Description: Lightning Network P2P Graph
Author: Brian Mancini
Latest version: 0.28.0

# @node-lightning/graph

This library constructs a graph as an adjacency list from P2P gossip messages.

This class includes the following types:

-   [GraphManger](/lib/graph-manager.ts) - constructs a graph from gossip messages
-   [Graph](/lib/graph.ts) - adjacency list representation of a graph
-   [Node](/lib/node.ts) - vertex in the graph
-   [Channel](/lib/channel.ts) - directional edge in the graph
-   [ChannelSettings](/lib/channel-settings.ts) - one directional edge information

## Examples

Message from a gossip emitter (defined in @node-lightning/wire) will be used to
construct an adjacency list based graph.

```typescript
const graphManager = new GossipManager(gossipEmitter);

graphManager.on("node", (node: Node) => {
    //
});

graphManager.on("channel", (channel: Channel) => {
    //
});

graphManager.on("channel_update", (channel: Channel, settings: ChannelSettings) => {
    //
});
```

The following events are emitted for the corresponding gossip message:

**channel_announcement message**

-   emits node event for node1 in channel
-   emits node event for node2 in channel
-   emits channel

**channel_update message**

-   emits channel_update event

**node_announcement message**

-   emits node event

### LND Serialization

You can serialize the graph instance in the same manner as the serialization
used in LND RPC calls.

```typescript
const serializer = new LndSerializer();
// to a plain-old JavaScript object
serializer.toObject(graph);

// to JSON
serializer.toJson(graph);
```
npm package: @node-lightning/logger
Description: Logging tool for Node-Lightning applications
Author: Brian Mancini
Latest version: 0.28.0

# Node-Lightning Logger

Logger for Node-Lightning modules that supports multi-transport, multi-area+instance logging using standard `util.format` sprintf value formatting.

### Getting Started

```bash
npm install @node-lightning/logger
```

To use the module you will need to create an area logger and include an optional instance identifier:

```javascript
const { manager } = require("@node-lightning/logger");

const area = "TEST";
const instanceId = "12345678";
const log = manager.create(area, instanceId);
```

Then you can write `debug`, `info`, `warn`, and `error` messages by passing a message an a variadic number of values. You can pass text, values, sprintf syle strings, or a string and a list of values that will be appended to the end of the message.

```javascript
log.debug("test");
log.info("hello");
log.warn("i'm warning you");
log.error("something went bad");
log.error(new Error("booooom"));
log.info("some stuff %j", { ok: true, foo: "bar" });
log.info("some values", 1, 2, 3, 4);
log.info("using %s formatting", "sprintf");
```

The above message should look similar to:

```
2019-07-22T13:28:37.854Z [DBG] TEST 12345678: test
2019-07-22T13:28:37.855Z [INF] TEST 12345678: hello
2019-07-22T13:28:37.855Z [WRN] TEST 12345678: i'm warning you
2019-07-22T13:28:37.855Z [ERR] TEST 12345678: something went bad
2019-07-22T13:28:37.856Z [ERR] TEST 12345678: Error: booooom
    at Object.<anonymous> (/code/go/src/github.com/altangent/node-lightning/packages/logger/test.js:9:11)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-07-22T13:28:37.856Z [INF] TEST 12345678: some stuff {"ok":true,"foo":"bar"}
2019-07-22T13:28:37.856Z [INF] TEST 12345678: some values 1 2 3 4
2019-07-22T13:28:37.856Z [INF] TEST 12345678: using sprintf formatting
```

### Output

The default instance of the logger will output to:

-   `console`
-   `node-lightning.log` file located at the root of the application runtime
npm package: @node-lightning/secp256k1
Description: Wrapper for Bitcoin libsecp256k1
Author: Brian Mancini
Latest version: 0.28.0

# @node-lightning/secp256k1

This library is heavily based on the [secp256k1](https://www.npmjs.com/package/secp256k1). The
primary changes to this library are:

-   remove dependency on Elliptic.js for in-browser usage
-   streamlined build dependencies (see below)
-   update reference to [libsecp256k1](https://github.com/bitcoin-core/secp256k1)

## Install

To improve the security of this module (reduce dependencies and allow audibility), the native build process is performed upon installation.

The build processes uses [`node-gyp`](https://www.npmjs.com/package/node-gyp) and its prerequisites must be available for the package to install correctly. Refer to the `node-gyp` [installation instructions]() for full details for your target environment.

Note: The [libsecp256k1](https://github.com/bitcoin-core/secp256k1) submodule is packaged in the package bundle (prior versions fetched code) so that `git` is no longer an installation requirement.

## Local Build

To perform a local build of the module requires initializing the `libsecp256k1` submodule:

```
git submodule update --init
```

You can then perform a standard `npm install`.
npm package: @node-lightning/wire
Description: Lightning Network Wire Protocol
Author: Brian Mancini
Latest version: 0.28.0

# `@node-lightning/wire`

This repository contains the wire protocol code for the Lightning Network and
includes the following functionality:

-   Peer which manages a connection to a peer. This class allows sending and
    emitting message traffic. It also manages internal state for Ping/Pong message
    traffic. [/lib/peer.ts](lib/peer.ts)

-   Messages defined in BOLT #1 - Base Protocol, BOLT #2 - Peer Protocol for
    Channel Management, and BOLT #7 P2P Node and Channel Discovery can be
    found in [/lib/messages](/lib/messages). This code includes the message
    types and serialization and deserialization methods for each message.

-   P2P Node and Channel gossip management that can be found in
    [/lib/gossip](/lib/gossip). This code contains the
    [GossipManger](/lib/gossip/gossip-manager) which controls gossip for many
    peers. Gossip synchronization for a single peer is managed through
    [PeerGossipSynchronizer](/lib/gossip/peer-gossip-synchronizer).
npm package: @node-llama-cpp/linux-arm64
Description: Prebuilt binary for node-llama-cpp for Linux arm64
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux arm64.

Do not install this package directly.
npm package: @node-llama-cpp/linux-armv7l
Description: Prebuilt binary for node-llama-cpp for Linux armv7l
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux armv7l.

Do not install this package directly.
npm package: @node-llama-cpp/linux-x64
Description: Prebuilt binary for node-llama-cpp for Linux x64
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux x64.

Do not install this package directly.
npm package: @node-llama-cpp/linux-x64-cuda
Description: Prebuilt binary for node-llama-cpp for Linux x64 with CUDA support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux x64 with CUDA support.

Do not install this package directly.
npm package: @node-llama-cpp/linux-x64-cuda-ext
Description: Extension of @node-llama-cpp/linux-x64-cuda - prebuilt binary for node-llama-cpp for Linux x64 with CUDA support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is an extension of the [`@node-llama-cpp/linux-x64-cuda`](https://www.npmjs.com/package/@node-llama-cpp/linux-x64-cuda) package
that provides a prebuilt binary for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux x64 with CUDA support.

Do not install this package directly.
npm package: @node-llama-cpp/linux-x64-vulkan
Description: Prebuilt binary for node-llama-cpp for Linux x64 with Vulkan support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Linux x64 with Vulkan support.

Do not install this package directly.
npm package: @node-llama-cpp/mac-arm64-metal
Description: Prebuilt binary for node-llama-cpp for macOS arm64 with Metal support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for macOS arm64 with Metal support.

Do not install this package directly.
npm package: @node-llama-cpp/mac-x64
Description: Prebuilt binary for node-llama-cpp for macOS x64
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for macOS x64.

Do not install this package directly.
npm package: @node-llama-cpp/win-arm64
Description: Prebuilt binary for node-llama-cpp for Windows arm64
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Windows arm64.

Do not install this package directly.
npm package: @node-llama-cpp/win-x64
Description: Prebuilt binary for node-llama-cpp for Windows x64
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Windows x64.

Do not install this package directly.
npm package: @node-llama-cpp/win-x64-cuda
Description: Prebuilt binary for node-llama-cpp for Windows x64 with CUDA support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Windows x64 with CUDA support.

Do not install this package directly.
npm package: @node-llama-cpp/win-x64-cuda-ext
Description: Extension of @node-llama-cpp/win-x64-cuda - prebuilt binary for node-llama-cpp for Windows x64 with CUDA support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is an extension of the [`@node-llama-cpp/win-x64-cuda`](https://www.npmjs.com/package/@node-llama-cpp/win-x64-cuda) package
that provides a prebuilt binary for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Windows x64 with CUDA support.

Do not install this package directly.
npm package: @node-llama-cpp/win-x64-vulkan
Description: Prebuilt binary for node-llama-cpp for Windows x64 with Vulkan support
Author: Gilad S.
Latest version: 3.18.1

# [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp)
This is a prebuilt binary package for [`node-llama-cpp`](https://github.com/withcatai/node-llama-cpp) for Windows x64 with Vulkan support.

Do not install this package directly.