open-index/open-npm huggingface dataset:
npm package: @litert/http
Description: A simple HTTP server based on LiteRT framework.
Author: Angus.Fenying
Latest version: 0.4.4

# LiteRT/HTTP

[![npm version](https://img.shields.io/npm/v/@litert/http.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/http "Stable Version")
[![npm version](https://img.shields.io/npm/v/@litert/http/dev.svg)](https://www.npmjs.com/package/@litert/http "Development Version")
[![License](https://img.shields.io/npm/l/@litert/http.svg?maxAge=2592000?style=plastic)](https://github.com/litert/http/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/http.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/http.js.svg)](https://github.com/litert/http.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/http.js.svg)](https://github.com/litert/http.js/releases "Stable Release")
[![GitHub Pre-Releases](https://img.shields.io/github/release/litert/http.js/all.svg)](https://github.com/litert/http.js/releases "Pre-Release")

A simple HTTP server based on LiteRT framework.

## Requirement

- TypeScript v2.6.1 (or newer)
- Node.js v8.0.0 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/http --save
```

Or install the developing (unstable) version for newest features:

```sh
npm i @litert/http@dev --save
```

## Document

### 简体中文版

- [v0.4.x](./docs/zh-CN/index.md)
- [v0.3.x](https://github.com/litert/http.js/blob/v0.3.1/docs/zh-CN/index.md)
- [v0.2.x](https://github.com/litert/http.js/blob/v0.2.3/docs/zh-CN/index.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/http-client
Description: A simple HTTP client based on LiteRT.
Author: Angus.Fenying
Latest version: 1.1.2

# LiteRT/HTTP Client

[![npm version](https://img.shields.io/npm/v/@litert/http-client.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/http-client "Stable Version")
[![npm version](https://img.shields.io/npm/v/@litert/http-client/dev.svg)](https://www.npmjs.com/package/@litert/http-client "Development Version")
[![License](https://img.shields.io/npm/l/@litert/http-client.svg?maxAge=2592000?style=plastic)](https://github.com/litert/http-client/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/http-client.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/http-client.js.svg)](https://github.com/litert/http-client.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/http-client.js.svg)](https://github.com/litert/http-client.js/releases "Stable Release")

A simple HTTP client based on LiteRT.

## Requirement

- TypeScript v3.2.2 (or newer)
- Node.js v10.0.0 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/http-client --save
```

## Document

### 简体中文版

- Preparing

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/http-proxy
Description: The HTTP proxy protocol library for LiteRT.
Author: Angus.Fenying
Latest version: 0.1.0

# LiteRT/Http-Proxy

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/http-proxy.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/http-proxy "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/http-proxy.svg?maxAge=2592000?style=plastic)](https://github.com/litert/http-proxy.js/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/http-proxy.js.svg)](https://github.com/litert/http-proxy.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/http-proxy.js.svg)](https://github.com/litert/http-proxy.js/releases "Stable Release")

The HTTP proxy protocol library for LiteRT.

> Currently, only client-side CONNECT is supported.

## Installation

```sh
npm install @litert/http-proxy --save
```

## Usage

- [HTTP Demo](./src/examples/test-http.ts)
- [HTTPS Demo](./src/examples/test-https.ts)
- [HTTP2 Demo](./src/examples/test-http2.ts)

## Requirements

- Node.js v14.x (Or newer)
- TypeScript v5.0.x (Or newer)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/idempotency
Description: The simple idempotency control implementation for Node.JS
Author: Angus.Fenying
Latest version: 0.1.0

# LiteRT/Idempotency

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/idempotency.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/idempotency "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/idempotency.svg?maxAge=2592000?style=plastic)](https://github.com/litert/idempotency/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/idempotency.js.svg)](https://github.com/litert/idempotency.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/idempotency.js.svg)](https://github.com/litert/idempotency.js/releases "Stable Release")

The simple idempotency control implementation for Node.JS

## Requirements

- TypeScript v5.0.x (Or newer)

## Installation

```sh
npm i @litert/idempotency --save
```

## Documents

- [en-US](https://litert.org/projects/idempotency.js/)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/interceptor
Description: A simple implements for interceptor in JavaScript/TypeScript.
Author: Angus.Fenying
Latest version: 1.0.0

# LiteRT/Interceptor

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/interceptor.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/interceptor "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/interceptor.svg?maxAge=2592000?style=plastic)](https://github.com/litert/interceptor/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/interceptor.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/interceptor.js.svg)](https://github.com/litert/interceptor.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/interceptor.js.svg)](https://github.com/litert/interceptor.js/releases "Stable Release")

A simple implements for interceptor in JavaScript/TypeScript.

## Requirement

- TypeScript v5 (or newer)
- Node.js v16 (or newer)

## Installation

```sh
npm i @litert/interceptor --save
```

## Usage

```ts
import { InterceptorChain } from "@litert/interceptor";

const chain = new InterceptorChain<IApiRequest, IApiResponse>([

    async function(ctx, next) { // logger

        const STARTED = Date.now();

        try {

            await next();
            console.log(`[INFO] ${ctx.input.method} ${ctx.input.url} ${Date.now() - STARTED}ms`);
        }
        catch (e) {

            console.error(`[ERROR] ${ctx.input.method} ${ctx.input.url} ${Date.now() - STARTED}ms`);
            console.error(e);
        }
    },

    async function(ctx) { // auth

        await authMgr.authenticate(ctx.input);
    },

    async function(ctx, next) { // rate limit

        await rateLimitMgr.check(ctx.input);
    },

    async function(ctx) { // dispatcher

        ctx.result = await apiDispatcher.dispatch(ctx.input);
    }
]);

const result = await chain.execute(apiReq);
```

See more in [examples](./src/examples/).

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/logger
Description: A logs-recorder for LiteRT framework.
Author: Angus.Fenying
Latest version: 2.1.0

# LiteRT/Logger

[![npm version](https://img.shields.io/npm/v/@litert/logger.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/logger "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/logger.svg?maxAge=2592000?style=plastic)](https://github.com/litert/logger/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/logger.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/logger.js.svg)](https://github.com/litert/logger.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/logger.js.svg)](https://github.com/litert/logger.js/releases "Stable Release")

A logs writer for LiteRT framework.

## Features

- [x] Log stack trace.
- [x] Enable/Disable log levels.
- [x] Custom levels.
- [x] Custom formats.
- [x] Custom output drivers.

## Requirement

- TypeScript v5.0.0 (or newer)
- Node.js v18.0.0 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/logger --save
```

## Quick Start

Simple usage:

```ts
// The imported module is a LoggerFactory singleton object, so you can use it directly.
import LoggerFactory from "@litert/logger";

const logger = LoggerFactory.createLogger('Demo');

logger.info('Hello, world!');
logger.warning('Hello, world!');

// Now, just disable a level, and it will not be printed.
logger.setLevelOptions({ levels: ['error'], enabled: false });

logger.error('Hello, world! (WILL NOT BE PRINTED)');

// let's turn on the stack trace, print 2 lines of stack trace.
//
// without specifying levels, all levels will be affected.
logger.setLevelOptions({ traceDepth: 2 });

logger.notice('Hello, world!');
```

Use custom log formatter:

```ts
import LoggerFactory from "@litert/logger";

LoggerFactory.setLevelOptions({ enabled: true });

const logger = LoggerFactory.createLogger('Demo');

logger.setLevelOptions({
    formatter: function(log, subj, lv, dt, traces): string {

        if (traces?.length) {

            return `${new Date(dt).toISOString()} - ${subj} - ${lv} - ${log}

  ${traces.join('\n  ')}
`;
        }

        return `${new Date(dt).toISOString()} - ${subj} - ${lv} - ${log}`;
    }
});

logger.info('Hello, world!');
logger.warning('Hello, world!');

logger.setLevelOptions({ traceDepth: 2 });

logger.error('Hello, world!');
```

More Examples:

- [Quick Start](./src/examples/quick-start.ts)
- [Custom log levels](./src/examples/custom-levels.ts)
- [Custom log formatter](./src/examples/custom-formatter.ts)
- [Custom log output driver](./src/examples/custom-driver.ts)
- [Using factory](./src/examples/using-factory.ts)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/lwdfx
Description: A TypeScript implement of light-weight data frame exchange protocol.
Author: Angus.Fenying
Latest version: 1.1.3

# LiteRT/LwDFX

[![npm version](https://img.shields.io/npm/v/@litert/lwdfx.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/lwdfx "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/lwdfx.svg?maxAge=2592000?style=plastic)](https://github.com/litert/lwdfx/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/lwdfx.js.svg)](https://github.com/litert/lwdfx.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/lwdfx.js.svg)](https://github.com/litert/lwdfx.js/releases "Stable Release")

An implement of the LwDFX (Light-weight Data Frame Exchange) protocol.

## Installation

```sh
npm install @litert/lwdfx --save
```

## Requirements

- Node.js v18.x (Or newer)
- TypeScript v5.0.x (Or newer)

## Documents

- [v1](./docs/v1.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/mime
Description: Get MIME type based on file name, path, and extension.
Author: hanguoshuai
Latest version: 0.1.3

# mime.js

<p align="center">
    <a href="https://github.com/litert/mime.js/blob/master/LICENSE">
        <img alt="License" src="https://img.shields.io/github/license/litert/mime.js?color=blue" />
    </a>
    <a href="https://www.npmjs.com/package/@litert/mime">
        <img alt="NPM stable version" src="https://img.shields.io/npm/v/@litert/mime?color=brightgreen&logo=npm" />
    </a><br>
    <a href="https://github.com/litert/mime.js/releases">
        <img alt="GitHub releases" src="https://img.shields.io/github/v/release/litert/mime.js?color=brightgreen&logo=github" />
    </a>
    <a href="https://github.com/litert/mime.js/issues">
        <img alt="GitHub issues" src="https://img.shields.io/github/issues/litert/mime.js?color=blue&logo=github" />
    </a>
</p>

Get MIME type based on file name, path, and extension.

> This repository doesn't require frequent updates, so even if it hasn't been updated for a long time, as long as it still exists, it means it's available. We'll keep an eye on whether it can function properly in the latest Node and browser environments.

## Languages

[简体中文](doc/README.sc.md) | [繁體中文](doc/README.tc.md) | [日本語](doc/README.ja.md)

## Installation

### NPM

In the Node.js environment, you can install directly using NPM:

```sh
$ npm i @litert/mime --save
```

### CDN

If you're using it in a browser, you can utilize the CDN mode.

```html
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'@litert/mime':'0.1.3'}"></script>
```

## Usage

Demo code is written using TypeScript.

```typescript
import * as mime from "@litert/mime";

mime.getData("hello.json");         // {"mime": "application/json", "compressible": true, extension: 'json'}
mime.getData(".html");              // {"mime": "text/html", "compressible": true, extension: 'html'}
mime.getData("css");                // {"mime": "text/css", "compressible": true, extension: 'css'}
mime.getData("hi/baby.js");         // {"mime": "application/javascript", "compressible": true, extension: 'js'}
mime.getData("/root/down/pk.zip");  // {"mime": "application/zip", "compressible": false, extension: 'zip'}
mime.getData("ext.dodooh");         // {"mime": "application/octet-stream", "compressible": false, extension: 'dodooh'}
mime.getMime("root/index.css");     // text/css
```

## Test

### Node

Once it's compiled correctly, you can run the sample code in the terminal by using `node ./dist/test-node`.

### Browser

To view the examples, simply access the `test/` directory in your browser.

[Click here to view the examples online](https://litert.github.io/mime.js/test/)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/mime-types
Description: Get MIME type based on file name.
Author: hanguoshuai
Latest version: 0.0.3
Deprecated: use @litert/mime instead

# mime-types

[![npm version](https://img.shields.io/npm/v/@litert/mime-types.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/mime-types "Stable Version")
[![npm version](https://img.shields.io/npm/v/@litert/mime-types/dev.svg)](https://www.npmjs.com/package/@litert/mime-types "Development Version")
[![License](https://img.shields.io/github/license/litert/mime-types.svg)](https://github.com/litert/mime-types/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/mime-types.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v10.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/mime-types.svg)](https://github.com/litert/mime-types/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/mime-types.svg)](https://github.com/litert/mime-types/releases "Stable Release")
[![GitHub Pre-Releases](https://img.shields.io/github/release/litert/mime-types/all.svg)](https://github.com/litert/mime-types/releases "Pre-Release")

Get MIME type based on file name.

## Installation

In the Node.js environment, you can install directly using NPM:

```sh
$ npm i @litert/mime-types --save
```

Or install the developing (unstable) version for newest features:

```sh
$ npm i @litert/mime-types@dev --save
```

## API

Demo code is written using TypeScript.

```typescript
import * as mime from "@litert/mime-types";

mime.get("hello.json");         // application/json
mime.get(".html");              // text/html
mime.get("css");                // text/css
mime.get("hi/baby.js");         // application/javascript
mime.get("/root/down/pk.zip");  // application/zip
mime.get("ext.dodooh");         // application/octet-stream
```

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/molo
Description: The DI and IoC implementation for LiteRT.
Author: Angus.Fenying
Latest version: 0.2.0
Deprecated: No maintenance anymore, do not use it

# LiteRT/Molo

[![npm version](https://img.shields.io/npm/v/@litert/molo.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/molo "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/molo.svg?maxAge=2592000?style=plastic)](https://github.com/litert/molo/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/molo.js.svg)](https://github.com/litert/molo.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/molo.js.svg)](https://github.com/litert/molo.js/releases "Stable Release")

The DI and IoC implementation for LiteRT.

> The package is still under development, any feature could possibly be changed before `v1.0.0`.

## Installation

```sh
npm install @litert/molo --save
```

## Requirements

- Node.js v8.x (Or newer)
- TypeScript v3.1.x (Or newer)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/molo-kits
Description: The CLI tool set for molo.js.
Author: Angus.Fenying
Latest version: 0.1.0
Deprecated: No maintenance anymore, do not use it

# LiteRT/Molo-Kits

[![npm version](https://img.shields.io/npm/v/@litert/molo-kits.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/molo-kits "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/molo-kits.svg?maxAge=2592000?style=plastic)](https://github.com/litert/molo-kits/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/molo-kits.svg)](https://github.com/litert/molo-kits/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/molo-kits.svg)](https://github.com/litert/molo-kits/releases "Stable Release")

The CLI tool set for molo.js.

> The package is still under development, any feature could possibly be changed before `v1.0.0`.

## Installation

```sh
npm install @litert/molo-kits --global
```

## Requirements

- Node.js v8.x (Or newer)
- TypeScript v3.1.x (Or newer)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/mutex
Description: A mutex implement for JavaScript.
Author: Angus.Fenying
Latest version: 0.2.1

# LiteRT/Mutex

[![npm version](https://img.shields.io/npm/v/@litert/mutex.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/mutex "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/mutex.svg?maxAge=2592000?style=plastic)](https://github.com/litert/mutex/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/mutex.js.svg)](https://github.com/litert/mutex.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/mutex.js.svg)](https://github.com/litert/mutex.js/releases "Stable Release")

A mutex implement for JavaScript.

## Requirement

- TypeScript v2.9.2 (or newer)

## Installation

```sh
npm i @litert/mutex --save
```

## Document

- [简体中文版](./docs/zh-CN/README.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/mutex-redis
Description: The redis driver for mutex.js.
Author: Angus.Fenying
Latest version: 0.2.0

# LiteRT/mutex-redis

[![npm version](https://img.shields.io/npm/v/@litert/mutex-redis.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/mutex-redis "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/mutex-redis.svg?maxAge=2592000?style=plastic)](https://github.com/litert/mutex-redis/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/mutex-redis.js.svg)](https://github.com/litert/mutex-redis.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/mutex-redis.js.svg)](https://github.com/litert/mutex-redis.js/releases "Stable Release")

The redis driver for mutex.js.

## Requirement

- TypeScript v4.0.0 (or newer)

## Installation

```sh
npm i @litert/mutex-redis --save
```

## Document

- [简体中文版](./docs/zh-CN/README.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/observable
Description: An implement of observation library for LiteRT.
Author: Angus.Fenying
Latest version: 0.3.0

# LiteRT/Observable

[![npm version](https://img.shields.io/npm/v/@litert/observable.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/observable "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/observable.svg?maxAge=2592000?style=plastic)](https://github.com/litert/observable/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/observable.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/observable.js.svg)](https://github.com/litert/observable.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/observable.js.svg)](https://github.com/litert/observable.js/releases "Stable Release")

An implement of observation library for LiteRT.

## Requirement

- TypeScript v3.1.x (or newer)
- Node.js v8.0.0 (or newer)

## Installation

```sh
npm i @litert/observable --save
```

## Usage

See [examples](./src/examples/).

## Document

Preparing yet.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/otp
Description: The TOTP & HOTP implement for Node.JS
Author: Angus.Fenying
Latest version: 2.0.0

# LiteRT/OTP

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/otp.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/otp "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/otp.svg?maxAge=2592000?style=plastic)](https://github.com/litert/otp/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/otp.js.svg)](https://github.com/litert/otp.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/otp.js.svg)](https://github.com/litert/otp.js/releases "Stable Release")

The TOTP & HOTP implement for Node.JS.

## Features

- [x] HOTP (HMAC-based One-Time Password) algorithm implementation.
- [x] TOTP (Time-based One-Time Password) algorithm implementation.
- [x] OTP URL encoding and decoding.
- [x] Command line tool:
    - [x] Generating OTP codes.
    - [x] Generating OTP URLs.
    - [x] Inspecting OTP URLs.
- [x] Customization:
    - [x] Digits length from 4 - 10
    - [x] TOTP time-step (period)
    - [x] Digest algorithms including SHA-1, SHA-256, and SHA-512

## Requirements

- TypeScript v3.1.x (Or newer)

## Installation

```sh
npm i @litert/otp --save
```

## Usage

### Use in code

See examples:

- [HOTP](./src/examples/hotp.ts)
- [TOTP](./src/examples/totp.ts)

Click [here](./docs/en-us/quick-start.md) for a quick start guide.

### Use as a command line tool

```sh
npm i -g @litert/otp
# or install in local project only
npm i @litert/otp # -D # if only used in dev environment
```

Then you can generate TOTP codes

```sh
npx otp -k 'raw:1234567890'
```

Click [here](./docs/en-us/cli-usage.md) for more details about the CLI usage.

## Documents

- [en-US](https://litert.org/projects/otp.js/)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/ottoia
Description: A simple multi-repository package manager of node.
Author: Angus.Fenying
Latest version: 0.4.5

# LiteRT/Ottoia

[![npm version](https://img.shields.io/npm/v/@litert/ottoia.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/ottoia "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/ottoia.svg?maxAge=2592000?style=plastic)](https://github.com/litert/ottoia/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/ottoia.js.svg)](https://github.com/litert/ottoia.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/ottoia.js.svg)](https://github.com/litert/ottoia.js/releases "Stable Release")

A simple multi-repository package manager of node.

## Installation

```sh
npm install @litert/ottoia -g
```

## Requirements

- Node.js v8.x (Or newer)
- TypeScript v3.1.x (Or newer)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/paypal-client
Description: The client for Paypal APIs.
Author: Angus.Fenying
Latest version: 0.2.0
Deprecated: No maintenance anymore, do not use it

# LiteRT/Paypal-Client

[![npm version](https://img.shields.io/npm/v/@litert/paypal-client.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/paypal-client "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/paypal-client.svg?maxAge=2592000?style=plastic)](https://github.com/litert/paypal-client/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/paypal-client.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/paypal-client.js.svg)](https://github.com/litert/paypal-client.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/paypal-client.js.svg)](https://github.com/litert/paypal-client.js/releases "Stable Release")

> UNSTABLE yet.

The Paypal REST-API client for Node.js.

## Requirement

- TypeScript v2.8.1 (or newer)
- Node.js v8.9.0 (or newer)

## Installation

```sh
npm i @litert/paypal-client --save
```

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/rache
Description: A resource cache management library.
Author: Angus.Fenying
Latest version: 0.2.0
Deprecated: No maintenance anymore, do not use it

# LiteRT/Rache

[![npm version](https://img.shields.io/npm/v/@litert/rache.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/rache "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/rache.svg?maxAge=2592000?style=plastic)](https://github.com/litert/rache/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/rache.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/rache.js.svg)](https://github.com/litert/rache.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/rache.js.svg)](https://github.com/litert/rache.js/releases "Stable Release")

A resource cache management library.

## Requirement

- TypeScript v2.8.1 (or newer)
- Node.js v8.0.0 (or newer)

## Installation

```sh
npm i @litert/rache --save
```

## Document

- [简体中文版](./docs/zh-CN/index.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/rache-redis
Description: The redis driver for Rache.js.
Author: Angus.Fenying
Latest version: 0.2.0
Deprecated: No maintenance anymore, do not use it

# LiteRT/Rache-Redis-Driver

[![npm version](https://img.shields.io/npm/v/@litert/rache-redis.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/rache-redis "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/rache-redis.svg?maxAge=2592000?style=plastic)](https://github.com/litert/rache-redis/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/rache-redis.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/rache-redis.js.svg)](https://github.com/litert/rache-redis.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/rache-redis.js.svg)](https://github.com/litert/rache-redis.js/releases "Stable Release")

The redis driver for Rache.js.

## Requirement

- TypeScript v2.8.1 (or newer)
- Node.js v8.0.0 (or newer)

## Installation

```sh
npm i @litert/rache-redis --save
```

## Usage

See the [sample](./src/samples/basic.ts).

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/reconnect
Description: An auto-reconnect connection controller library.
Author: Angus.Fenying
Latest version: 0.1.1
Deprecated: No maintenance anymore, do not use it

# LiteRT/Reconnect

[![npm version](https://img.shields.io/npm/v/@litert/reconnect.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/reconnect "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/reconnect.svg?maxAge=2592000?style=plastic)](https://github.com/litert/reconnect/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/reconnect.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/reconnect.js.svg)](https://github.com/litert/reconnect.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/reconnect.js.svg)](https://github.com/litert/reconnect.js/releases "Stable Release")

An auto-reconnect connection controller library.

## Requirement

- TypeScript v2.8.1 (or newer)
- Node.js v6.0.0 (or newer)

## Installation

```sh
npm i @litert/reconnect --save
```

## Document

- [简体中文版](./docs/zh-CN/index.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/redis
Description: A redis protocol implement for Node.js.
Author: Angus.Fenying
Latest version: 3.2.0

# LiteRT/Redis

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/redis.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/redis "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/redis.svg?maxAge=2592000?style=plastic)](https://github.com/litert/redis/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/redis.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/redis.js.svg)](https://github.com/litert/redis.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/redis.js.svg)](https://github.com/litert/redis.js/releases "Stable Release")

A redis protocol implement for Node.js.

## Features

- [x] Support read/write separation.
- [x] Support pipeline.
- [x] Support multi and exec.
- [x] Support subscribe and publish.

## Requirement

- TypeScript v3.5.1 (or newer)
- Node.js v10.0.0 (or newer)

## Installation

```sh
npm i @litert/redis --save
```

## Document

- [简体中文版](./docs/zh-CN/index.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/reflect
Description: A simple implementation of reflect & metadata.
Author: Angus.Fenying
Latest version: 1.0.0

# LiteRT/Reflect

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/reflect.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/reflect "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/reflect.svg?maxAge=2592000?style=plastic)](https://github.com/litert/reflect.js/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/reflect.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/reflect.js.svg)](https://github.com/litert/reflect.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/reflect.js.svg)](https://github.com/litert/reflect.js/releases "Stable Release")

A simple implementation of reflect & metadata.

## Requirement

- TypeScript v4.3.x (or newer)
- ECMAScript 2017 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/reflect --save
```

> For usage, see [demo](./src/examples/demo.ts)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/scheduler
Description: A simple Scheduler based on LiteRT framework.
Author: xrb
Latest version: 0.1.3
Deprecated: stopped maintained for useless

# LiteRT/Scheduler

[![npm version](https://img.shields.io/npm/v/@litert/scheduler.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/scheduler "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/scheduler.svg?maxAge=2592000?style=plastic)](https://github.com/litert/scheduler/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/scheduler.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/scheduler.js.svg)](https://github.com/litert/scheduler.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/scheduler.js.svg)](https://github.com/litert/scheduler.js/releases "Stable Release")

A simple Scheduler based on LiteRT framework.

## Requirement

- TypeScript v3.2.2 (or newer)
- Node.js v10.0.0 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/scheduler --save
```

## Document

Preparing yet.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/signatures
Description: A signatures library based on Node.js crypto module.
Author: Angus.Fenying
Latest version: 4.0.0

# LiteRT/Signatures

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/signatures.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/signatures "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/signatures.svg?maxAge=2592000?style=plastic)](https://github.com/litert/signatures/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/signatures.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/signatures.js.svg)](https://github.com/litert/signatures.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/signatures.js.svg)](https://github.com/litert/signatures.js/releases "Stable Release")

A signatures library based on Node.js crypto module.

## Requirement

- TypeScript v5.0.x (or newer)
- Node.js v18.0.0 (or newer)

## Installation

```sh
npm i @litert/signatures --save
```

## Usage

- [Hash/Digest](./src/examples/00-hash.ts)

    The utilities API for calculating hash/digest of data.

- [HMAC](./src/examples/01-hmac.ts)

    The API for signing/verifying data using HMAC.

- [RSA](./src/examples/02-rsa.ts)

    The API for signing/verifying data using RSA.

- [RSA-PSS](./src/examples/03-rsa-pss.ts)

    The API for signing/verifying data using RSA-PSS.

- [EcDSA](./src/examples/04-ecdsa.ts)

    The API for signing/verifying data using EcDSA.

- [EdDSA](./src/examples/05-eddsa.ts)

    The API for signing/verifying data using EdDSA.

## Document

- [API Docs (en-US)](https://litert.org/projects/signatures.js/api-docs)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/socks5
Description: The socks5 protocol library for LiteRT.
Author: Angus.Fenying
Latest version: 0.1.1

# LiteRT/Socks5

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/socks5.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/socks5 "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/socks5.svg?maxAge=2592000?style=plastic)](https://github.com/litert/socks5.js/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/socks5.js.svg)](https://github.com/litert/socks5.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/socks5.js.svg)](https://github.com/litert/socks5.js/releases "Stable Release")

The socks5 protocol library for LiteRT.

> Currently, only client-side CONNECT is supported.

## Installation

```sh
npm install @litert/socks5 --save
```

## Usage

```ts
import * as Socks5 from '@litert/socks5';

(async () => {

    const socket = await Socks5.connect({
        'server': {
            'host': '127.0.0.1', // hostname of socks5 server
            'port': 1080, // port of socks5 server
            'auth': { // optional auth info, set to null or omit it if unnecessary
                'username': 'user1',
                'password': 'my-password'
            }
        },
        'target': {
            /**
             * The type of hostname is optional.
             *
             * If omitted, the lib will detect it automatically
             */
            // 'type': Socks5.Constants.ETargetHostnameType.IPV4,
            'host': '1.1.1.1', // Or a domain
            'port': 443,
        }
    });

    // now a socket connected to 1.1.1.1:443 through socks5 server 127.0.0.1:1080 is created and ready.
    // feel free to use it.

})();
```

## Requirements

- Node.js v14.x (Or newer)
- TypeScript v5.0.x (Or newer)

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/televoke
Description: A simple RPC service framework.
Author: Angus.Fenying
Latest version: 1.3.1

# LiteRT/Televoke

[![npm version](https://img.shields.io/npm/v/@litert/televoke.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/televoke "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/televoke.svg?maxAge=2592000?style=plastic)](https://github.com/litert/televoke/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/televoke.js.svg)](https://github.com/litert/televoke.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/televoke.js.svg)](https://github.com/litert/televoke.js/releases "Stable Release")

A simple RPC service framework.

## Installation

```sh
npm install @litert/televoke --save
```

## Requirements

- Node.js v18.x (Or newer)
- TypeScript v5.0.x (Or newer)

## Implemented Protocol

- `http/1.1`  (televoke/1)
- `https/1.1` (televoke/1)
- `ws/wss`    (televoke/2)

    > [`@litert/websocket`](https://github.com/litert/websocket.js) package is required.

- `lwdfx/1`   (televoke/2)

    > [`@litert/lwdfx`](https://github.com/litert/lwdfx.js) package is required.

Check documents about `televoke/2` protocol [here](./docs/Televoke_v2.md).

## Documents

Preparing.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/timezone
Description: The timezone support library of LiteRT.
Author: Angus.Fenying
Latest version: 0.1.3

# LiteRT/TimeZone

[![npm version](https://img.shields.io/npm/v/@litert/timezone.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/timezone "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/timezone.svg?maxAge=2592000?style=plastic)](https://github.com/litert/timezone/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/litert/timezone.js.svg)](https://github.com/litert/timezone.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/timezone.js.svg)](https://github.com/litert/timezone.js/releases "Stable Release")

The timezone support library of LiteRT.

> Copyright: This is just a toolset of timezone operation for JavaScript.
> As all timezone data is extracted from [WikiPedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

## Requirements

- TypeScript v3.1.x (Or newer)

## Installation

```sh
npm i @litert/timezone --save
```

## Usage

```ts
import TZ from "@litert/timezone";

console.log(TZ.findByName("Asia/Brunei")); // Find the info of timezone Asia/Brunei.

console.log(TZ.findByLocation("US")); // Find the list of timezone used by US.

console.log(TZ.findByOffset(480)); // Find the list of timezones whose offset is 480 (from UTC, ini).

console.log(TZ.findByDSTOffset(480)); // Find the list of timezones whose DST offset is 480.

console.log(TZ.findCanonicalList()); // Find out list of all canonical timezone.

console.log(TZ.offsetToString(480)); // Convert minute offset into string, which should be +08:00.

console.log(TZ.offsetFromString('-08:00')); // Convert a string into minute offset, which should be -480.
```

## Documents

Preparing yet.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/tlds
Description: A simple TLD (Top Level Domain) helper library.
Author: Angus.Fenying
Latest version: 0.2.0

# LiteRT/TLD

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/tlds.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/tlds "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/tlds.svg?maxAge=2592000?style=plastic)](https://github.com/litert/tlds/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/tlds.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/tlds.js.svg)](https://github.com/litert/tlds.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/tlds.js.svg)](https://github.com/litert/tlds.js/releases "Stable Release")

A simple TLD (Top Level Domain) helper library.

## Installation

Install by NPM:

```sh
npm i @litert/tlds --save
```

## Usage

See [src/examples/demo.ts](./src/examples/demo.ts).

> How to import full TLD list?
>
> 1. Get data from https://publicsuffix.org/list/public_suffix_list.dat
> 2. Parse the data into string array (pay attention to some TLD items like `*.xxx.xx`)
> 3. Now import them into your `TLDManager`.

## Requirement

- TypeScript v3.2.2 (or newer)
- Node.js v10.0.0 (or newer)

## Document

### 简体中文版

- Preparing

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/tls-sni
Description: A TLS SNI(Server Name Indication) library for Node.js.
Author: Angus.Fenying
Latest version: 1.0.0

# LiteRT/TLS-SNI

[![npm version](https://img.shields.io/npm/v/@litert/tls-sni.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/tls-sni "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/tls-sni.svg?maxAge=2592000?style=plastic)](https://github.com/litert/tls-sni/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/tls-sni.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/tls-sni.js.svg)](https://github.com/litert/tls-sni.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/tls-sni.js.svg)](https://github.com/litert/tls-sni.js/releases "Stable Release")

A TLS SNI(Server Name Indication) library for Node.js.

## Features

- [x] TypeScript Supports.
- [x] X.509 Certificate Decoder
- [x] Partial DER Decoder
- [x] Certificate Manager
- [x] Graceful Update Certificate.
- [x] RSA Certificate Supports.
- [x] RSA Key Pair Supports.
- [x] EC Certificate Supports.
- [x] EC Key Pair Supports.

## Requirement

- TypeScript v3.2.x (or newer)
- Node.js v10.0.0 (or newer)

## Installation

```sh
npm i @litert/tls-sni --save
```

## Usage

```ts
import * as libsni from "@litert/tls-sni";
import * as TLS from "tls";
import * as FS from "fs";

// 1. Create a certificate mananger object.
const cm = libsni.certs.createManager();

// 2. Load a certificate into certificate mananger
cm.use(
    "default",
    FS.readFileSync(`./certs/default/cert-20190801.pem`),
    FS.readFileSync(`./certs/default/key-20190801.pem`)
);

// 3. Create a TLS server with the SNI callback provided by ceritificate manager.
const server = TLS.createServer({
    SNICallback: cm.getSNICallback(),
    ...otherOptions
});

// ...

// 4. Check if there are some certificates outdating.

const outdatingCerts = cm.findExpiringCertificates(
    Date.now() + 28 * 86400000 // Optional, 7 days by default
); // Get the list of certificate names, which are outdating in 28 days.

// ...

// 5. When a cert is being outdated, replace it with a new one.
cm.use(
    "default",
    FS.readFileSync(`./certs/default/cert-20190901.pem`),
    FS.readFileSync(`./certs/default/key-20190901.pem`)
);
```

> More usage, see [examples](./src/examples/).

## Document

Preparing yet.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/tokens
Description: A token serialization & unserialization library.
Author: Angus.Fenying
Latest version: 0.3.0

# LiteRT/Tokens

[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
[![npm version](https://img.shields.io/npm/v/@litert/tokens.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/tokens "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/tokens.svg?maxAge=2592000?style=plastic)](https://github.com/litert/tokens/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/tokens.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/tokens.js.svg)](https://github.com/litert/tokens.js/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/tokens.js.svg)](https://github.com/litert/tokens.js/releases "Stable Release")

A token serialization & unserialization library.

## Requirement

- TypeScript v4.0.x (or newer)
- Node.js v12.0.0 (or newer)

## Installation

```sh
npm i @litert/tokens --save
```

## Usage

```ts
import * as Tokens from "@litert/tokens";

// Create a JWT encoder.
const jwts = Tokens.createJWTEncoder();

// Register a profile with HMAC-SHA-512 algorithm.
jwts.registerHMACProfile({
    name: 'test-hs512',
    algorithm: 'sha512',
    key: 'hello world',
    predefinedPayload: {
        aud: 'https://litert.org'
    },
    predefinedHeaders: {
        vid: 123456
    }
});

// Create a JWT with hs512 profile.
const testJWT = jwts.create("test-hs512", {
    "iss": "Heaven",
    "name": "Hik"
});

// Print the JWT string.
console.log(testJWT);

// Try to verify it, if verified successfully, check the testInfo.signature.
const testInfo = jwts.verify(testJWT, "test-hs512");

if (testInfo.signature.verified) {

    console.info("Success!");
}
else {

    console.error("Failed!");
}

// Print the JWT structure.
console.log(JSON.stringify(testInfo, null, 2));
```

## Document

Preparing yet.

## License

This library is published under [Apache-2.0](./LICENSE) license.
npm package: @litert/typeguard
Description: An easy and powerful data validation code generator by JavaScript.
Author: Angus.Fenying
Latest version: 1.4.2

# LiteRT/TypeGuard

[![npm version](https://img.shields.io/npm/v/@litert/typeguard.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/typeguard "Stable Version")
[![License](https://img.shields.io/npm/l/@litert/typeguard.svg?maxAge=2592000?style=plastic)](https://github.com/litert/typeguard/blob/master/LICENSE)
[![node](https://img.shields.io/node/v/@litert/typeguard.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
[![GitHub issues](https://img.shields.io/github/issues/litert/type-guard.svg)](https://github.com/litert/type-guard/issues)
[![GitHub Releases](https://img.shields.io/github/release/litert/type-guard.svg)](https://github.com/litert/type-guard/releases "Stable Release")

An easy and powerful data validation code generator by JavaScript.

## Requirement

- TypeScript v3.3.x (or newer)
- ECMAScript 2017 (or newer)

## Installation

Install by NPM:

```sh
npm i @litert/typeguard --save
```

## Document

- [简体中文版](./docs/zh-CN/README.md)

## License

This library is published under [Apache-2.0](./LICENSE) license.