open-index/open-npm huggingface dataset:
npm package: @manyducks.co/emitter
Description: Stripped down, type-safe event emitter for client and server.
Author: tony@manyducks.co
Latest version: 1.1.2

# @manyducks.co/emitter

![bundle size](https://img.shields.io/bundlephobia/min/@manyducks.co/emitter)
![bundle size](https://img.shields.io/bundlephobia/minzip/@manyducks.co/emitter)

Emitter is a stripped down, modern event emitter with type safety for your custom events via TypeScript. Even if you don't use TypeScript, it's still a featherweight event emitter designed to work on the frontend or backend.

## Install

```
npm install @manyducks.co/emitter
```

## Use

```ts
import { Emitter } from "@manyducks.co/emitter";

// You provide an event map where keys are event names and
// values are tuples of arguments listener functions will receive.
type Events = {
  "counter:increment": [amount: number];
  "counter:decrement": [amount: number];
  "counter:reset": [];
};

const emitter = new Emitter<Events>();

let count = 0;

emitter.on("counter:increment", (amount) => {
  // Amount is typed as a number.
  count += amount;
});
emitter.on("counter:decrement", (amount) => {
  count -= amount;
});
emitter.on("counter:reset", () => {
  count = 0;
});

// This is valid.
emitter.emit("counter:increment", 1);

// But TypeScript will object to this:
emitter.emit("counter:increment", "five hundred and two");
//                                ~~~~~~~~~~~~~~~~~~~~~~
//          Argument of type 'string' is not assignable to parameter of type 'number'.

// And this:
emitter.emit("counter:increment", 1, 2, 3);
//                                   ~~~~
//          Expected 2 arguments, but got 4.
```

### Full API

```ts
emitter.on("eventName", listener);
// Adds a listener for a specific event.

emitter.off("eventName", listener);
// Removes a listener for a specific event.

emitter.once("eventName", listener);
// Adds a listener that will be removed after the next time it's called.

emitter.clear();
// Removes all listeners for all events.

emitter.emit("eventName", ...args);
// Emits an event, taking arguments to forward to listeners.

emitter.listeners("eventName");
// Returns the array of listeners for a specific event.
emitter.listeners("eventName").length;
emitter.listeners("eventName").unshift(listener);
// You can use this to do things like count and prepend listeners.

emitter.events();
// Returns an array of eventNames for all events with listeners.
```

Those are the methods. There are also a couple of special values for `eventName`.

```ts
emitter.on("*", (eventName, ...args) => {
  // Adds a listener that gets called for each and every emitted event.
});

emitter.on("error", (error, eventName, ...args) => {
  // Adds a listener that will receive any errors thrown within listeners.
  //
  // By default, errors that occur in listeners will be thrown by the `emit` function.
  // If there is at least one error listener then errors will be emitted instead.
});
```

## License

Emitter is provided under the MIT license.

---

🦆 [That's a lot of ducks.](https://www.manyducks.co)
npm package: @manyipkg/mermaid-server
Description: Http server for converting mermaid diagrams to png, svg, pdf.
Author: Manyi
Latest version: 1.0.2

# Mermaid Server

## 简介
Mermaid Server 是一个 HTTP 服务器，用于将 Mermaid 图表定义转换为 PNG、SVG 和 PDF 格式的图片。借助该服务器，你可以通过简单的 HTTP 请求将 Mermaid 代码转换为可视化图表。

## 功能特性
- 支持将 Mermaid 图表定义转换为 PNG、SVG 和 PDF 格式。
- 可自定义主题、背景颜色、图片尺寸等参数。
- 支持通过 HTTP 请求进行图表转换。

## 安装
### 前提条件
- Node.js (版本 ^18.19 或 >=20.0)
- npm (推荐版本 10.8.1 及以上)

### 安装步骤
1. 克隆项目仓库（如果是从仓库获取）：
```bash
# 如果是从仓库获取代码，请执行此命令
git clone https://gitee.com/manyiprj/mermaid-server.git
cd mermaid-server
```
2. 安装依赖：
```bash
npm install
```

## 使用方法
### 启动服务器
```bash
npm start
```
默认情况下，服务器将在 `http://0.0.0.0:8123` 启动。

### 转换图表
发送 POST 请求到 `/convert_mermaid` 端点进行图表转换。请求体示例如下：
```json
{
    "definition": "graph TD\n    A[Christmas] -->|Get money| B(Go shopping)\n    B --> C{Let me think}\n    C -->|One| D[Laptop]\n    C -->|Two| E[iPhone]\n    C -->|Three| F[Car]",
    "theme": "default",
    "format": "png",
    "pdfFit": true,
    "backgroundColor": "white",
    "svgId": "my-svg",
    "width": 3200,
    "height": 2400,
    "scale": 1
}
```

### 请求参数说明
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| definition | string | 是 | - | Mermaid 图表定义代码 |
| theme | string | 否 | default | 图表主题 |
| format | string | 否 | png | 输出格式，可选值：png, pdf, svg |
| pdfFit | boolean | 否 | true | 仅适用于 PDF 格式，是否自适应内容 |
| backgroundColor | string | 否 | white | 背景颜色 |
| svgId | string | 否 | my-svg | SVG 元素的 ID |
| width | number | 否 | 3200 | 图片宽度 |
| height | number | 否 | 2400 | 图片高度 |
| scale | number | 否 | 1 | 缩放比例 |

## 命令行工具
可以通过 `mmds` 命令行工具使用本项目功能（具体请参考 `package.json` 中 `bin` 字段配置）。
支持的参数 mmds -p 8123
npm package: @manylov/sdk
Description: Typescript SDK to interact with the DEX in Tg
Latest version: 0.0.1

<div align="center">
 <h1>STON.fi SDK</h1>
</div>

[![TON](https://img.shields.io/badge/based%20on-TON-blue)](https://ton.org/)
[![License](https://img.shields.io/npm/l/@ston-fi/sdk)](https://img.shields.io/npm/l/@ston-fi/sdk)
[![npm version](https://img.shields.io/npm/v/@ston-fi/sdk/latest.svg)](https://www.npmjs.com/package/@ston-fi/sdk/v/latest)

Documentation on this SDK is available at [docs.ston.fi](https://docs.ston.fi/docs/technical-reference/sdk/gettingstarted)

> **Warning**
> SDK is still under development and breaking changes might and probably will happen in the future. According to the [semantic versioning convention](https://semver.org/#spec-item-4), while the package's major version is zero, breaking changes might happen even in minor releases. Because of that, **if you are using SDK at this stage in production**, please **make sure that you are using the exact version of the package** in your `package.json` file
> ​

## Installation

To install SDK via NPM use

```bash
npm install tonweb @ston-fi/sdk

yarn add tonweb @ston-fi/sdk
```