open-index/open-npm huggingface dataset:
npm package: @hz-9/a4-cache
Description: A library for cache management in `@hz-9/a4-*` applications. It internally utilizes [cache-manager](https://www.npmjs.com/package/cache-manager) for management.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-cache

A library for cache management in `@hz-9/a4-*` applications. It internally utilizes [cache-manager](https://www.npmjs.com/package/cache-manager) for management.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-cache
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-cache
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-cache

[English Document](https://hz-9.github.io/a4/guide/a4-cache/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-cache/)
npm package: @hz-9/a4-cli
Description: A code generation tool for `@hz-9/a4-*` applications. It is recommended not to use `@nest/cli`.
Author: Chen Zhen
Latest version: 0.2.4

# @hz-9/a4-cli

A code generation tool for `@hz-9/a4-*` applications. It is recommended not to use `@nest/cli`.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-cli
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-cli
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-cli

[English Document](https://hz-9.github.io/a4/guide/a4-cli/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-cli/)
npm package: @hz-9/a4-config
Description: A library for loading configuration information in `@hz-9/a4-*` applications. It supports multiple configuration loading schemes.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-config

A library for loading configuration information in `@hz-9/a4-*` applications. It supports multiple configuration loading schemes.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-config
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-config
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-config

[English Document](https://hz-9.github.io/a4/guide/a4-config/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-config/)
npm package: @hz-9/a4-core
Description: The core library for the `@hz-9/a4-*` series of repositories.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-core

The core library for the `@hz-9/a4-*` series of repositories. It is used to bootstrap application services, encapsulate `NestApplication` and `NestFactory`, and create common classes for `@hz-9/a4-*`.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-core
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-core
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-core

[English Document](https://hz-9.github.io/a4/guide/a4-core/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-core/)
npm package: @hz-9/a4-crud-elasticsearch
Description: A library for performing CRUD operations with Elasticsearch in `@hz-9/a4-*` applications. It provides multi-instance connections to Elasticsearch, offers ORM capabilities, and provides a set of functions for managing indices.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-crud-elasticsearch

A library for performing CRUD operations with Elasticsearch in `@hz-9/a4-*` applications. It provides multi-instance connections to Elasticsearch, offers ORM capabilities, and provides a set of functions for managing indices.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-crud-elasticsearch
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-crud-elasticsearch
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-crud-elasticsearch

[English Document](https://hz-9.github.io/a4/guide/a4-crud-elasticsearch/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-crud-elasticsearch/)
npm package: @hz-9/a4-crud-typeorm
Description: A library for performing CRUD operations with [TypeORM] in `@hz-9/a4-*` applications. It provides a set of functions for managing entities.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-crud-typeorm

A library for performing CRUD operations with [TypeORM] in `@hz-9/a4-*` applications. It provides a set of functions for managing entities.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[TypeORM]: https://typeorm.io/
[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-crud-typeorm
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-crud-typeorm
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-crud-typeorm

[English Document](https://hz-9.github.io/a4/guide/a4-crud-typeorm/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-crud-typeorm/)
npm package: @hz-9/a4-docs
Description: A library for generating and previewing API documentation in `@hz-9/a4-*` applications. It provides [OpenAPI] documentation generation and preview capabilities.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-docs

A library for generating and previewing API documentation in `@hz-9/a4-*` applications. It provides [OpenAPI] documentation generation and preview capabilities.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[OpenAPI]: https://www.openapis.org/
[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-docs
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-docs
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-docs

[English Document](https://hz-9.github.io/a4/guide/a4-docs/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-docs/)
npm package: @hz-9/a4-lock-redlock
Description: A library for using redlock in `@hz-9/a4-*` applications. It internally utilizes [redlock](https://www.npmjs.com/package/redlock) for handling distributed locks.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-lock-redlock

A library for using redlock in `@hz-9/a4-*` applications. It internally utilizes [redlock](https://www.npmjs.com/package/redlock) for handling distributed locks.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-lock-redlock
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-lock-redlock
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-lock-redlock

[English Document](https://hz-9.github.io/a4/guide/a4-lock-redlock/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-lock-redlock/)
npm package: @hz-9/a4-log-log4js
Description: A library for a logging module in @hz-9/a4-* applications. It utilizes [log4js] for implementation.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-log-log4js

A library for a logging module in @hz-9/a4-* applications. It utilizes [log4js] for implementation.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[log4js]: https://www.npmjs.com/package/log4js
[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-log-log4js
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-log-log4js
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-log-log4js

[English Document](https://hz-9.github.io/a4/guide/a4-log-log4js/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-log-log4js/)
npm package: @hz-9/a4-micro-service
Description: A library for microservice RPC communication in `@hz-9/a4-*` applications. It is implemented based on `@nest/microservices`.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-micro-service

A library for microservice RPC communication in `@hz-9/a4-*` applications. It is implemented based on `@nest/microservices`.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-micro-service
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-micro-service
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-micro-service

[English Document](https://hz-9.github.io/a4/guide/a4-micro-service/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-micro-service/)
npm package: @hz-9/a4-network
Description: A library for network module in `@hz-9/a4-*` applications. It provides functionality to retrieve the current network interface cards and available port numbers.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-network

A library for network module in `@hz-9/a4-*` applications. It provides functionality to retrieve the current network interface cards and available port numbers.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-network
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-network
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-network

[English Document](https://hz-9.github.io/a4/guide/a4-network/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-network/)
npm package: @hz-9/a4-registry-eureka
Description: A library for a registry center module in @hz-9/a4-* applications. It utilizes [@rocketsoftware/eureka-js-client] for implementation.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-registry-eureka

A library for a registry center module in @hz-9/a4-* applications. It utilizes [@rocketsoftware/eureka-js-client] for implementation.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[@rocketsoftware/eureka-js-client]: https://www.npmjs.com/package/@rocketsoftware/eureka-js-client
[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-registry-eureka
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-registry-eureka
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-registry-eureka

[English Document](https://hz-9.github.io/a4/guide/a4-registry-eureka/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-registry-eureka/)
npm package: @hz-9/a4-safe
Description: A library for safe module in `@hz-9/a4-*` applications.  It controls CORS configuration and utilizes Helmet for security defenses.
Author: Chen Zhen
Latest version: 0.3.4

# @hz-9/a4-safe

A library for safe module in `@hz-9/a4-*` applications.  It controls CORS configuration and utilizes Helmet for security defenses.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/a4-safe
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/a4-safe
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/a4-safe

[English Document](https://hz-9.github.io/a4/guide/a4-safe/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/a4-safe/)
npm package: @hz-9/algorithm
Description: A JavaScript algorithm base class library.
Author: Chen Zhen
Latest version: 0.2.2

# @hz-9/algorithm

A JavaScript algorithm base class library.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url] ![Types][types-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[npm-version-url]: https://badgen.net/npm/v/@hz-9/algorithm
[npm-license-url]: https://badgen.net/npm/license/@hz-9/algorithm
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/algorithm
[types-url]: https://badgen.net/npm/types/@hz-9/algorithm
[node-version-url]: https://badgen.net/npm/node/@hz-9/algorithm
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/tool

[Document](https://hz-9.github.io/tool/guide/algorithm/) | [文档](https://hz-9.github.io/tool/zh-CN/guide/algorithm/)

## Introduction

A JavaScript algorithm base class library.

## Installation

``` bash
npm install --global @hz-9/algorithm
```

## Usage

``` ts
import { selectionSort } from "@hz-9/algorithm";

console.log("selectionSort", selectionSort([5, 4, 3, 2, 1]));
```
npm package: @hz-9/docs-build
Description: A toos for generate vuepress-theme-hopo from typescript project.
Author: Chen Zhen
Latest version: 0.7.5

# @hz-9/docs-build

A toos for generate [vuepress-theme-hopo] from typescript project.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url] ![Types][types-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[vuepress-theme-hopo]: https://theme-hope.vuejs.press/
[npm-version-url]: https://badgen.net/npm/v/@hz-9/docs-build
[npm-license-url]: https://badgen.net/npm/license/@hz-9/docs-build
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/docs-build
[types-url]: https://badgen.net/npm/types/@hz-9/docs-build
[node-version-url]: https://badgen.net/npm/node/@hz-9/docs-build
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/tool

[Document](https://hz-9.github.io/tool/guide/docs-build/) | [文档](https://hz-9.github.io/tool/zh-CN/guide/docs-build/)

## Introduction

`@hz-9/docs-build` will scan the markdown files of a project based on certain rules and compile them into a [vuepress-theme-hopo] website. For logic, please refer to the [Scan Rule](https://hz-9.github.io/tool/guide/docs-build/scan-rule.html).

## Installation

``` bash
npm install --global @hz-9/docs-build
```

## Usage

Get help:

``` bash
docs-build --help
```

Minimal execution:

``` bash
docs-build
```

Developer mode:

``` bash
docs-build --action serve
```

> `serve` only listens for changes in file content. If a file that matches the rules is added, the current command needs to be restarted.

Production Env:

``` bash
docs-build --action build
```

## Parameters

### -r, --root

The execution path, default is `process.cwd()`. This parameter will affects the reading of the `package.json` file and the resolution of other relative paths.

### -c, --config

The path to `api-extractor.json`. Support absolute path or relative path.

### --docs-space

The space to docs website. If omitted, it is `./docs/.vuepress`.

### --markdown-path

The markdown folder generated using `@microsoft/api-documenter`. If omitted, it is `./docs/.markdowns`.

### -a, --action

Vuepress Action. Support `serve` or `build`.

### --base-url

Vuepress base url. If omitted, it is `/`.
npm package: @hz-9/eslint-config-airbnb
Description: A eslint config for 'hz-9' (JavaScript)
Author: Chen Zhen
Latest version: 0.4.0

# @hz-9/eslint-config-airbnb

A [eslint] config for 'hz-9' (JavaScript).

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[eslint]: https://eslint.org/
[npm-version-url]: https://badgen.net/npm/v/@hz-9/eslint-config-airbnb
[npm-license-url]: https://badgen.net/npm/license/@hz-9/eslint-config-airbnb
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/eslint-config-airbnb
[node-version-url]: https://badgen.net/npm/node/@hz-9/eslint-config-airbnb
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/lint

[Document](https://hz-9.github.io/lint/guide/eslint-config-airbnb/) | [文档](https://hz-9.github.io/lint/zh-CN/guide/eslint-config-airbnb/)

## Installation

To install the `@hz-9/eslint-config-airbnb` package, run the following command:

```bash
npm install @hz-9/eslint-config-airbnb --save-dev
```

## Usage

To use this configuration, add the following code to your `.eslintrc.js` file:

```javascript
module.exports = {
  extends: [
    '@hz-9/eslint-config-airbnb'
  ],
}
```

After that, you can run the ESLint fix command to automatically fix linting issues:

```bash
eslint --fix .
```
npm package: @hz-9/eslint-config-airbnb-ts
Description: A eslint config for 'hz-9' (TypeScript)
Author: Chen Zhen
Latest version: 0.6.2

# @hz-9/eslint-config-airbnb-ts

A [eslint] config for 'hz-9' (TypeScript).

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[eslint]: https://eslint.org/
[npm-version-url]: https://badgen.net/npm/v/@hz-9/eslint-config-airbnb-ts
[npm-license-url]: https://badgen.net/npm/license/@hz-9/eslint-config-airbnb-ts
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/eslint-config-airbnb-ts
[node-version-url]: https://badgen.net/npm/node/@hz-9/eslint-config-airbnb-ts
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/lint

[Document](https://hz-9.github.io/lint/guide/eslint-config-airbnb-ts/) | [文档](https://hz-9.github.io/lint/zh-CN/guide/eslint-config-airbnb-ts/)

## Installation

To install the `@hz-9/eslint-config-airbnb-ts` package, run the following command:

```bash
npm install @hz-9/eslint-config-airbnb-ts --save-dev
```

## Usage

To use this configuration, add the following code to your `.eslintrc.js` file:

```javascript
module.exports = {
  extends: [
    '@hz-9/eslint-config-airbnb-ts/node'
  ],
  parserOptions: {
    tsconfigRootDir: __dirname,
  },
}
```

After that, you can run the ESLint fix command to automatically fix linting issues:

```bash
eslint --fix .
```

## Q & A

## You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser

You can set `parseOptions.project` params.

```javascript
module.exports = {
  extends: [
    '@hz-9/eslint-config-airbnb-ts/node'
  ],
  parserOptions: {
    project: 'tsconfig.json',
    tsconfigRootDir: __dirname,
  },
}
```
npm package: @hz-9/heft-nest-plugin
Description: A heft plugin package for Nest.js projects.
Author: Chen Zhen
Latest version: 0.1.2

# @hz-9/heft-nest-plugin

A heft plugin package for Nest.js projects.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/heft-nest-plugin
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/heft-nest-plugin
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/heft-nest-plugin

[English Document](https://hz-9.github.io/a4/guide/heft-nest-plugin/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/heft-nest-plugin/)
npm package: @hz-9/heft-nest-rig
Description: A rig package for Nest.js projects that build using Heft build system.
Author: Chen Zhen
Latest version: 0.1.2

# @hz-9/heft-nest-rig

A rig package for Nest.js projects that build using Heft build system. To learn more about rig packages, consult the [@rushstack/rig-package] documentation.

[@rushstack/rig-package]: https://www.npmjs.com/package/@rushstack/rig-package

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]

[npm-version-url]: https://img.shields.io/npm/v/@hz-9/heft-nest-rig
[npm-license-url]: https://img.shields.io/npm/l/@hz-9/heft-nest-rig
[npm-downloads-url]: https://img.shields.io/npm/d18m/@hz-9/heft-nest-rig

[English Document](https://hz-9.github.io/a4/guide/heft-nest-rig/) | [中文文档](https://hz-9.github.io/a4/zh-CN/guide/heft-nest-rig/)
npm package: @hz-9/heft-node-rig
Description: A rig package for Node.js projects that build using Heft build system.
Author: Chen Zhen
Latest version: 0.5.0

# @hz-9/heft-node-rig

A rig package for Node.js projects that build using Heft build system. To learn more about rig packages, consult the [@rushstack/rig-package] documentation.

[@rushstack/rig-package]: https://www.npmjs.com/package/@rushstack/rig-package

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[npm-version-url]: https://badgen.net/npm/v/@hz-9/heft-node-rig
[npm-license-url]: https://badgen.net/npm/license/@hz-9/heft-node-rig
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/heft-node-rig
[node-version-url]: https://badgen.net/npm/node/@hz-9/heft-node-rig
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/tool

[Document](https://hz-9.github.io/tool/guide/heft-node-rig/) | [文档](https://hz-9.github.io/tool/zh-CN/guide/heft-node-rig/)
npm package: @hz-9/prettier-config
Description: A prettier config for 'hz-9' (JavaScript)
Author: Chen Zhen
Latest version: 0.1.2

# @hz-9/prettier-config

A [prettier] config for 'hz-9'.

![NPM Version][npm-version-url] ![NPM License][npm-license-url] ![NPM Downloads][npm-downloads-url]
<br /> ![Node Version][node-version-url] ![Last Commit][last-commit-url]

[prettier]: https://prettier.io/
[npm-version-url]: https://badgen.net/npm/v/@hz-9/prettier-config
[npm-license-url]: https://badgen.net/npm/license/@hz-9/prettier-config
[npm-downloads-url]: https://badgen.net/npm/dt/@hz-9/prettier-config
[node-version-url]: https://badgen.net/npm/node/@hz-9/prettier-config
[last-commit-url]: https://badgen.net/github/last-commit/hz-9/lint

[Document](https://hz-9.github.io/lint/guide/prettier-config/) | [文档](https://hz-9.github.io/lint/zh-CN/guide/prettier-config/)

## Installation

To install the `@hz-9/prettier-config` package, run the following command:

```bash
npm install @hz-9/prettier-config --save-dev
```

## Usage

To use this configuration, add the following code to your `.prettierrc.js` file:

```javascript
const prettierConfig = require('@hz-9/prettier-config')

module.exports = prettierConfig
```

After that, you can run the formatting command to adjust the file format:

```bash
prettier --write .
```
npm package: @hz-9/redlock-dist
Description: A derived version of Redlock.
Latest version: 5.0.0-beta.2-3

# @hz-9/redlock-dist

从 [redlock](https://www.npmjs.com/package/redlock) 分叉并对 `package.json` 进行了修改。

## 安装

``` bash
npm install --global @hz-9/redlock-dist
```

## 使用

在配置好你的 `tsconfig.json` 文件后，将以下内容添加到你的代码库中：

``` ts
import Redlock from '@hz-9/redlock-dist'

const redlock = new Redlock([...redisClients], { /* options */ })

```

更详细的使用说明，请参考 [official redlock library documentation](https://www.npmjs.com/package/redlock)。

## 简介

该包是 `redlock` 构建输出的修改版本。它不是源代码的直接复制。

当 `tsconfig.json` 配置了特定属性时，`typescript` 将从 `package.json` 中读取 `exports` 字段。

然而，`redlock@5.0.0-beta.2` 在其 `package.json` 没有设置 `"exports['.'].types": "./dist/index.d.ts"`，这导致 TypeScript 无法正确解析类型文件。

此外，`redlock@5.0.0-beta.2` 在其 `package.json` 中使用了 `"type": "module"`，它默认为 ESM (ES Module) 格式。因此，创建了 `@hz-9/redlock-dist`。

## 与 `redlock` 的不同之处

- 与 `redlock` 相比，`@hz-9/redlock-dist` 的 `package.json` 进行了哪些修改？

  1. 移除了 `"type": "module"` 属性。
  2. 移除了 `"scripts"` 属性。
  3. 添加了 `"exports['.'].types": "./dist/index.d.ts"` 属性。

- `@hz-9/redlock-dist` 支持哪些 `tsconfig.json` 配置？

你可以查看 [tsconfig.json](https://github.com/hz-9/collection-space/blob/master/test-space/hz-9/redlock-dist/ts-node18-cjs/t-1.tsconfig.json)。

## 发布

```sh
npm publish
```
npm package: @hz-lib/han-ui-next
Description: 瀚正 UI组件库
Latest version: 0.1.30

# 组件库开发指南与规范

## 前言

组件库fork自[element-plus](https://element-plus.gitee.io/#/zh-CN/component/installation)。开发语言为vue3和typescript，内部添加了一些自定义的组件，并且封装了一些区块组件，并不包含业务组件。

开发规范已element-plus的为基准，但鉴于element项目开发周期较短，甚至代码内部有些已定义未使用的代码，所以在借鉴其他优秀组件库如antd和开源项目的基础上，制定本指南和规范，并尽量使开发体验与业务项目保持一致。

因组件库的特殊性，架构设计与平时业务项目区别很大，故对组件库的设计进行一个介绍及指南。



## 开发指南

#### 步骤如下

​	以caption为例

1. 运行script下的 gc.sh自动在package下新建组件文件夹
2. 在packages/theme-chalk下添加组件scss文件，如captions.scss
3. 在packages/theme-chalk/index.scss内引入上述scss
4. 在packages/han-ui-next/index内引入并注册组件
5. 在packages/han-ui-next/package.json内引入组件依赖
6. 运行yarn bootstrap将新组件引入依赖
7. 运行yarn run website-dev:play 打开模拟测试环境并将代码调试完成
8. 在组件文件夹下的tests下完善测试用例
9. 在website/docs下新建md文件，如caption.md
10. 在nav.config.json内配置上述md文件
11. 运行yarn run website-dev跑起来文档网站
12. 在上述md文件中，完善文档、测试功能。
13. 在vetur下配置vetur自动提示
14. 运行yarn run build打包组件库

如果想了解具体架构，请看下面的章节。不了解也不影响开发。

## element源码架构设计

### 使用的库

#### rollup

通俗的讲用于打包JavaScript，可以把js多个js文件合并为一个大的文件，并且在这个过程中，可以通过插件进行处理Typescript、提取css等。[文档点此](https://www.rollupjs.com)，[开发ui库入门点此](https://www.jianshu.com/p/a038e794d6e8)。element-plus用rollup打包 组件bundle

#### webpack

基础-略

####  gulp

基于node的自动化构建工具，主要就是用于任务自动化，基于stream，可以使用各种插件处理文件。

组件库用于样式文件和字体图标，hanui第一版也使用了用于将css色值处理为css变量。

#### lerna

把代码库组织成多包储存库，组件库内各个组件都是一个单独的包，都有自己的package.json。主要为了按需引用。我们自己的业务项目也有使用，为了解决多地区与基础产品的组织问题。

### 目录解析

- build：打包相关

  - bincomp：扫描packages下所有的包运行`build.component.js`打包为ems格式
  - build-locale：用于国际化
  - build-util：rollup打包工具，供sh脚本使用
  - build.component：rollup打包组件为bundle
  - build.comps：对打包的组件修改名称，供sh脚本使用
  - build.entry：打包入口，供sh脚本使用
  - build：定义基础的rollup打包方法
  - common：略
  - gen-type：通过node的fs把组件库内部定义的typescript类型文件拷贝到打包后的库
  - gen-version：略
  - getCpus：略
  - getPkgs：略
  - rollup.config.bundle：打包packages/element-plus/index.ts
  - rollup.config：没发现被使用
  - webpack.config：TODO

- packages：组件与样式

- sripts：sh脚本

  - build：下载依赖并打包
  - gc：自动在packages新建标准的组件
  - pulish：提交脚本
  - update-versions：略

- typings：定义了全局的类型

- vetur：给vetur提供了自动提示

- website：文档项目

  - demo-styles：md内的demo需要的样式
  - docs
    - zh-CN：这里写md文档
  - play：在此可以随意测试，已经自动导入所有组件



## build时发生了什么

```js
yarn bootstrap
yarn clean:lib
yarn build:esm-bundle
yarn build:lib
yarn build:lib-full
yarn build:esm
yarn build:utils
yarn build:locale
yarn build:locale-umd
yarn build:theme
```



## formcreate指南

打包命令为yarn run build:form
npm package: @hz-solutions/restful-api-interceptor
Description: restful-api-interceptor是一个axios插件，用来对API返回的结果进行反序列化。
Latest version: 1.0.4

## 简介
restful-api-interceptor是一个axios插件，用来对API返回的结果进行反序列化。

## API数据约定
```json
  {
    "data": {
      "type": "Order",
      "attributes": {
        "id": 1,
        "price": "12.98",
        "description": "some string data",
        "created_at": "2019-03-18T03:58:19.286Z",
      }
    },
    "meta": {
      "pagination": {
        "timestamp": "2019-03-18T03:58:19.286Z",
        "current": 1,
        "total": 10,
        "count": 98
      }
    }
  }
```

## 用法
API返回的结果会根据transformer定义的规则执行转换。

```javascript
  import RestfulApiInterceptor, {
    date,
    bigNumber,
  } from '@hz-solutions/restful-api-interceptor';

  const interceptor = new RestfulApiInterceptor();

  interceptor.registerEntity({
    type: 'Order',
    transformer: {
      price: bigNumber,
      created_at: date,
    },
  });

  interceptor.registerMeta({
    type: 'pagination',
    transformer: {
      timestamp: date,
    },
  });

  axios.interceptors.response.use(interceptor.responseInterceptor);
```
npm package: @hz_org/hz-library
Description: hezhong library
Author: hezhong yanfa
Latest version: 1.1.25

<!--
 * @Author: bowen
 * @Date: 2022-08-17 16:19:25
 * @LastEditors: zengxianghui1
 * @LastEditTime: 2022-11-18 08:27:48
 * @Description: file content
-->

# 注意事项

node 版本要求：16+

# 开发须知

所有业务组件以 B 字母开头命名

## 组件开发

组件开发请前往 `/packages` 文件夹里创建组件文件夹要求开头字母大写，`index.ts` 文件用来导出组件。 `src` 文件夹里存放组件 组件命名要求开头字母大写。并撰写响应组件的 markdown 文档。

## 文档撰写

在 `/docs/examples` 文件夹里创建对应名称的组件文件夹。将文档所需的文件存到文件夹里。默认 markdown 名称为 `README.md` 。

并在 `/docs/examples/.vuepress/config.js` 文件下配置 sidebar。

## 打包组件

```bash
    pnpm build
```

## 本地运行文档

```bash
    pnpm docs:dev
```

## 本地打包文档

```bash
    pnpm docs:build
```

## 发布 npm 改变 packjson 版本

```bash
    npm publish
```

## 代码提交

```bash
    #  1.全局代码格式化
    pnpm format
    #  2.eslint全局校验
    pnpm lint
    #  3.代码暂存
    git add .
    #  4.填写代码提交
    pnpm cz
```
npm package: @hz_org/utils
Description: utils
Author: hezhong developers
Latest version: 1.0.4

<!--
 * @Description: 
 * @Version: 1.0
 * @Author: zengxianghui
 * @Date: 2022-08-18 09:26:02
 * @LastEditors: zengxianghui1
 * @LastEditTime: 2022-08-18 09:48:54
-->
## @hz_org/utils

前端工具类npm
### 安装

`npm i @hz_org/utils or @hz_org/utils`

### API

- 获取浏览器可视区域高度
  `getClientHeight(): number`
- 百度坐标转高德
  `bMapConvertGMap(geo: geoType): geoType`
- 高德坐标转百度
  `gMapConvertBMap(geo: geoType): geoType`
- 对象数组去重
  `arrayUnique(arr = [], uniId = 'id'): array`
- 深拷贝
  `deepClone(obj: Object): object`
- 获取UUID
  `getUUID(): number`
- 对象属性复制（以左侧对象为准）
  `leftAssign(obj1: Object, obj2: Object): obj1`
- 生成随机len位数字
  `randomNumber(length, date): number`
- Element Plus Form 校验银行卡号位数
  `validateBankCard(rule, value, callback)`
- Element Plus Form 只能输入中文
  `validateChinese(rule, value, callback)`
- Element Plus Form 校验身份证号
  `validateIdCard(rule, value = '', callback)`
- Element Plus Form 验证手机号+固定电话
  `validateLandlineAndTel(rule, value, callback)`
- Element Plus Form 校验手机号码
  `validateTel(rule, value, callback)`

### API

- esModule
  ```
  import { getClientHeight } from "@hz_org/utils"
  ```

- cdn
  ```
  <script src="https://cdn.jsdelivr.net/npm/@hz_org/utils/index.js"></script>

  console.log(window['@hz_org/utils'].getClientHeight())
  ```

### 本地开发

```
git clone至本地
npm install
src下新建文件编写
```

### 打包编译

```
npm run build
```

### npm 发布

```
1.更新package.json的version
2.copy根目录下的package.json和README.md至dist目录下
3.cd dist
4.npm login
5.npm publish --access=public
```