open-index/open-npm huggingface dataset:
npm package: @kldx/core
Description: Kunlun core SDK
Author: zhouwexin
Latest version: 4.16.3

## Kunlun DX 后端 @kldx/core 版本说明：

-------
### 版本：4.14.x｜兼容升级
新功能：支持流程中「Node.js」节点调用新版本「低代码」模块本地开发的函数。
- 同步调用：`await context.function('newFunc').invoke(params);`
- 异步任务：`await context.tasks.createAsyncTask('newFunc', params);`
- 分布式任务：`await context.tasks.createDistributedTask(dataset, 'newHandlerFunc', 'newProgressCallbackFunc', 'newCompletedCallbackFunc', options);`

-------
### 版本：4.13.x｜兼容升级
新功能：支持通过 OQL 进行数据库读写，详见 [OQL 开发指南](https://bytedance.feishu.cn/docx/doxcnXmnqtRboRPmsLMExFmZJde) 。
```js
let result = await context.db.oql("select _email from _user").execute();
```

-------
### 版本：4.12.x｜兼容升级
新功能：记录查询操作支持查询所有。
```js
let records = await context.db.object("_user").findAll();
```

-------
### 版本：4.11.x｜兼容升级
新功能：记录写入操作支持批量事务。
```js
let tx = context.db.newTransaction()
tx.object().registerBatchCreate()
tx.object().registerBatchUpdate()
tx.object().registerBatchDelete()
```
优化：返回值类型为「日期」的「公式」字段支持查询过滤。

-------
### 版本：4.10.x｜兼容升级
新功能：支持获取单/多个用户的 Locale 信息。调用路径：`context.user.getLocale`。

优化：在「操作」的「函数节点」中的 `context.initiator` 中增加了操作人的 Locale 信息，并整体移动到了 `context.user.initiator`（兼容了 `context.initiator`）。

-------
### 版本：4.9.x｜不兼容升级
新功能：支持使用「文件 id」下载文件。调用路径：`context.resources.file.download`。

不兼容点：当 `download` 中传递 `filePath` 参数时，返回值由 `Promise<Buffer>` 调整为 `Promise<void>`。

-------
### 版本：4.8.x｜兼容升级
新功能：支持发送 HTTP 请求的 API。调用路径：`kunlun.tool.http`。

优化：lookup 类型字段的数据结构中支持 `_id`、`_name`。（兼容历史数据中的 `id`、`name`）。

-------
### 版本：4.7.x｜不兼容升级
优化：
+ `context.workflow.updateVariable` 支持表单变量。
+ 支持在「自动化流程」和「函数」中使用 `context.workflow.terminate` 以终止工作流。

不兼容点：废除 `kunlun.operators.hasAllOf`。

-------
### 版本：4.6.x｜兼容升级
新功能：记录写入操作支持事务。
```js
let tx = context.db.newTransaction()
tx.object().registerCreate()
tx.object().registerUpdate()
tx.object().registerDelete()
```
优化：支持使用「关联对象字段」下的子字段设置为查询条件。

-------
### 版本：4.5.x｜不兼容升级
新功能：
+ 重命名记录的批量异步接口
```
batchCreate -> batchCreateAsync
batchUpdate -> batchUpdateAsync
batchDelete -> batchDeleteAsync
```
+ 新增记录的批量同步接口 `batchCreate`、`batchUpdate`、`batchDelete`。

不兼容点：原批量异步接口变为了同步接口。

-------
各功能的详细用法，见 [自定义函数开发指南](https://bytedance.feishu.cn/docs/doccnNsMCaPhyjyRb9kXLu1eAEb)
npm package: @kldzj/debug
Description: A simple debugger.
Author: Nikolai Kolodziej
Latest version: 1.0.0

Just another simple JavaScript debugger.

## Installation

Using yarn:

```sh-session
$ yarn add @kldzj/debug
```

Using npm:

```sh-session
$ npm i -S @kldzj/debug
```

## Example usage

```typescript
// demo.js
import { createDebugger } from "@kldzj/debug";

const debug = createDebugger("test");
debug.debug("Hello World");

// you can enable/disable the debugger during runtime:
debug.disable();
debug.enable();

// you can also create child debuggers:
const child = debug.createChild("comp");

child.debug("Hello World");
// would log: [test:comp] Hello World

// ...

// if you don't want to handle the `Debugger` class instance
// you can create a simple function interface right away:
const debug = createDebugger("test").createFunction();
debug("Hello World");
```

```shell
# In your terminal:
$ DEBUG=test:* node demo.js
```
npm package: @kldzj/env
Description: A simple and type-safe env parser
Author: Nikolai Kolodziej
Latest version: 1.0.3

A simple environment variable parser with type safety and validation out of the box.

## Installation

Using yarn:

```sh-session
$ yarn add @kldzj/env
```

Using npm:

```sh-session
$ npm i -S @kldzj/env
```

## Features

- Type safety
- Custom parsers
- Optional (and default) values
- Passing a custom environment object

## Example usage

```typescript
import { parseEnv } from '@kldzj/env';

const env = parseEnv({
  PORT: {
    type: 'number',
    optional: true,
    default: 3000,
  },
  NODE_ENV: {
    type: 'string',
    optional: true,
  },
  DB_URL: {
    type: 'string',
  },
});

console.log(env.PORT); // typed as number
console.log(env.NODE_ENV); // typed as string | undefined
console.log(env.DB_URL); // typed as string, an error is thrown in case it's missing
```

## Parser

The parser is a function that takes a string and returns a value of any type. It can be used to parse environment variables that are not strings.

If a parser is present, the type of the variable is ignored and instead the return type of the parser is used.

```typescript
import { parseEnv } from '@kldzj/env';

const env = parseEnv({
  DATE: {
    parser: (value) => new Date(value),
  },
});

console.log(env.DATE); // typed as Date
```

## Options

```typescript
const env = parseEnv(
  {
    PORT: {
      type: 'number',
    },
  },
  {
    env: {
      ...process.env,
      ...someOtherEnv,
    },
    throwOnNaN: true,
    defaultParser: (value, item) => {
      // The default parser must honor the type of the variable (item.type) if it is present
      // ...
      return newValue;
    },
  }
);
```

### `env`

An object that contains the environment variables. If not provided, `process.env` is used.

### `throwOnNaN`

If `true`, an error is thrown if a variable type is number and is parsed as `NaN`. Defaults to `false`.

### `defaultParser`

Allows you to override the default parser. The default parser is used when a variable does not have a custom parser.
npm package: @kldzj/puppeteer-stream
Description: Screen capture puppeteer pages using either CDP tools or fmmpeg's x11grab
Author: Nikolai Kolodziej
Latest version: 0.0.0

Using this package you are able to screen capture your puppeteer pages.

## Installation

To use this package a [ffmpeg](https://www.ffmpeg.org/) binary needs to be available. You can obtain it from [here](https://ffmpeg.org/download.html) or using the [ffmpeg-static](https://www.npmjs.com/package/ffmpeg-static) package.

Using yarn:

```sh-session
$ yarn add @kldzj/puppeteer-stream
```

Using npm:

```sh-session
$ npm i -S @kldzj/puppeteer-stream
```

## Usage

View the [examples](https://github.com/kldzj/puppeteer-stream/tree/master/examples) on how to use this package.

### Notes on using the `x11` recorder

When using the `x11` recorder it is recommended to render to a [`xvfb`](https://en.wikipedia.org/wiki/X_Window_System#Xvfb) server.

```sh-session
$ export DEBUG=puppeteer-stream:*
$ xvfb-run -s "-screen 0 1920x1080x24" yarn ts-node examples/x11.ts
```

### Code

```typescript
const browser = await puppeteer.launch();
const page = await browser.newPage();

// https://github.com/puppeteer/puppeteer/issues/6904
const streamer = new PuppeteerStreamer(page as unknown as Page, {
  // ffmpegPath: '/path/to/ffmpeg',
  output: {
    format: 'mp4',
    path: join(process.cwd(), 'output.mp4'),
  },
  frameSize: {
    width: 1280,
    height: 720,
  },
  fps: 30,
});

// navigate page
await page.goto('https://example.com');

// start recording
await streamer.start();

// do something
await page.waitFor(1000);

// stop recording
await streamer.stop();

// finish up
await browser.close();
```
npm package: @kldzj/rcon
Description: An easy-to-use RCON client written in TypeScript.
Author: Nikolai Kolodziej
Latest version: 0.0.2

This package aims to provide a simple and easy to use interface to the RCON TCP and UDP specifications.

## Installation

Using yarn:

```sh-session
$ yarn add @kldzj/rcon
```

Using npm:

```sh-session
$ npm i -S @kldzj/rcon
```

## Usage

```typescript
import { createConnection, RconProtocol } from '@kldzj/rcon';

const rcon = createConnection({
  host: '127.0.0.1',
  port: 27015,
  password: 'dQw4w9WgXcQ',
  protocol: RconProtocol.UDP,
  // or use RconProtocol.TCP (default)
  challenge: true, // make use of UDP challenge auth
});

// the only way to get responses when using UDP is to use the 'response' event
rcon.on('response', (str) => console.log(str));

await rcon.connect();

// when using TCP, the response is returned as a promise,
// while UDP will simply return the command you put in
const status = await rcon.send('status');

await rcon.send('quit');

// disconnect once you're done
await rcon.disconnect();
```
npm package: @kldzj/stream-throttle
Description: Throttle one or multiple stream(s) to a maximum rate
Author: kldzj
Latest version: 1.1.1

## stream-throttle

A simple Node.js stream throttler.

### Installation

Using yarn:

```sh-session
$ yarn add @kldzj/stream-throttle
```

Using npm:

```sh-session
$ npm i -S @kldzj/stream-throttle
```

### Usage

#### Options

- `rate`: The rate in bytes per second at which to emit data.
- `burst`: The burst rate in bytes per second. Must be greather than or equal to `rate`. Defaults to `rate`.
- `chunkSize`: The size of chunks to split the received data into. Must be less than or equal to `rate`. Defaults to `rate / 10`.

#### `Throttle`

Used to throttle the output rate of a single stream.

```typescript
import { Throttle } from '@kldzj/stream-throttle';

const throttle = new Throttle({ rate: 10 });
process.stdin.pipe(throttle).pipe(process.stdout);
```

#### `ThrottleGroup`

Used to throttle the output rate across multiple streams.

```typescript
import { createConnection } from 'net';
import { ThrottleGroup } from '@kldzj/stream-throttle';

const group = new ThrottleGroup({ rate: 1024 * 1024 });
const addr = { host: 'www.google.com', port: 80 };
const throttled1 = createConnection(addr).pipe(group.createThrottle());
const throttled2 = createConnection(addr).pipe(group.createThrottle());
// ...
```

#### Changing the rate on-the-fly

```typescript
const group = new ThrottleGroup({ rate: 1024 * 1024 });
// or group = new Throttle({ rate: 1024 * 1024 }).group;
// ...

group.setRate(4 * 1024 * 1024);
// in case you calculate the chunkSize differently
// you should call `setChunkSize` as well, as `setRate`
// recalculates `chunkSize`
group.setChunkSize(group.rate / 6);
// in addition, you can also call `setBurst` if
// you want to change the burst rate
group.setBurst(group.rate * 1.5);

// ...
```

## Special thanks

- [@tjgq](https://github.com/tjgq) for the initial implementation ([`stream-throttle`](https://github.com/tjgq/node-stream-throttle)).
npm package: @kldzj/which
Description: Look up executable(s) in directories listed in your PATH(s)
Author: Nikolai Kolodziej
Latest version: 1.0.1

## which

A [`which (1)`](https://linux.die.net/man/1/which)-like utility.

Returns the single first instance of the command executable that can be found, and null otherwise.

### Usage

```typescript
// async (promise)
import { which } from '@kldzj/which';

const ffmpegPath = await which('ffmpeg');

// sync (import as you prefer)
import { which, whichSync } from '@kldzj/which';

const nodePath = which.sync('node');
const samePath = whichSync('node');
```

### Options

```typescript
import { join } from 'path';
import { which } from '@kldzj/which';

const path = await which('executable', {
  // pass additional paths to search in
  paths: [join(__dirname, 'bin')],
  // pass additional extensions to search for
  exeExt: ['.xyz'],
});
```
npm package: @klearthinkk/create-ynest
Description: new nest.js project from klearthinkk
Author: yasuoyuhao
Latest version: 1.1.2

---
description: 本篇文章將介紹如何快速開始 yNest
---

# 快速開始

## 基本介紹

ynest, 是一個幫助項目開始的腳手架，目前包含了 nest.js、flutter 項目，內置 CI/CD 等自動化腳本設定。

[文件位置](https://yasuoyuhao.gitbook.io/ynest)  
[原始碼位置](https://github.com/yasuoyuhao/ynest)

## 基本指令

請使用以下指令快速開始：

```bash
yarn create @klearthinkk/ynest
```

或者：

```bash
npx @klearthinkk/create-ynest
```

接下來，你會看到以下選項：

```text
What project template would you like to generate? (Use arrow keys)
❯ flutter-gitlab
  nestjs-general
```

* `flutter-gitlab` 可以快速啟動一個 `flutter App`，其中包含了自動化 CI/CD，以及企業級的環境配置方式，詳細用法可以參考[這裡](https://www.appcoda.com.tw/flutter-app-%E7%92%B0%E5%A2%83%E7%AE%A1%E7%90%86/)。
* `nestjs-general` 可以快速啟動與建置一個 `nest.js App`，其中包含了自動化 CI/CD、容器化設定、TypeORM 配置、Elasticsearch、Redis、RabbitMQ與企業級的環境配置方式。

詳細內容請參考[文件](https://yasuoyuhao.gitbook.io/ynest)
npm package: @klebba/element-server
Description: Serves your element.
Author: Casey Klebba
Latest version: 1.0.5

# Element Server

It mounts `/${npm_package_name}` at `/node_modules/${npm_package_name}` to emulate the installed path of your element.

```
yarn install @klebba/element-server --save-dev
yarn run element-server
```
npm package: @klebba/x-element
Description: Custom Element base class.
Author: Casey Klebba
Latest version: 1.0.0-rc.18

# XElement

A base class for creating Custom Elements. Adapted from https://github.com/kenchris/lit-element

```
yarn install && yarn start
```

Then...
* http://localhost:8080
* http://localhost:8080/demo
* http://localhost:8080/demo/react
* http://localhost:8080/test
npm package: @kleber-swf/phaser-particle-editor-plugin
Description: Phaser Particle Editor Plugin
Author: Kleber Silva
Latest version: 1.1.1

# Phaser Particle Editor Plugin

[![Build Status](https://travis-ci.org/koreezgames/phaser-particle-editor-plugin.svg?branch=master)](https://travis-ci.org/koreezgames/phaser-particle-editor-plugin) [![Project status](https://img.shields.io/badge/status-active-brightgreen.svg)](#status)

> This project is a fork of the excellent plugin [@koreez/phaser-particle-editor-plugin](https://www.npmjs.com/package/@koreez/phaser-particle-editor-plugin)
>
> The aim here is just add typescript support and change things around as our team needs without breaking the internet.

This plugin creates particle effects based on JSON data generated by **[Phaser Particle Editor](https://phaser-particle-editor.firebaseapp.com/)**

## Getting Started

### Installation

#### **_Using script tag:_**

[![](https://data.jsdelivr.com/v1/package/npm/@koreez/phaser-particle-editor-plugin/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@koreez/phaser-particle-editor-plugin/dist/plugin.min.js)

```html
<script src="//cdn.jsdelivr.net/npm/@koreez/phaser-particle-editor-plugin/dist/plugin.min.js"></script>
```

#### **_Using npm:_**

[![npm](https://img.shields.io/npm/dt/@koreez/phaser-particle-editor-plugin.svg)](https://www.npmjs.com/package/@koreez/phaser-particle-editor-plugin)

```shell
$ npm i --save  @kleber-swf/phaser-particle-editor-plugin
```

## Usage

### Import the plugin

##### **_CommonJS_**

```javascript
var ParticleEditorPlugin = require("@kleber-swf/phaser-particle-editor-plugin");
```

##### **_ES2015_**

```javascript
import ParticleEditorPlugin from "@kleber-swf/phaser-particle-editor-plugin";
```

### Load the plugin

You need to load the plugin in your game. This is done just like any other plugin in Phaser.
So, to load the plugin, include it one of the Phaser States.

```javascript
game.plugins.add(ParticleEditorPlugin);
```

The plugin will patch your Phaser game with additional _add / make_ methods so this plugin fits up in Phaser like any normal object.

### Create particles

```javascript
// x - any
// y - any
// data - should be already loaded JSON key or existing object based on Particle Editor data
// group - parent container
game.add.particleEffect(x, y, data, group);
// or
game.make.particleEffect(x, y, data);
```

## News & Community

We have a [forum](http://www.html5gamedevs.com/topic/33387-phaser-particle-editor/) so you can always be up to date with latest news!

## Contributing

Coming soon!