open-index/open-npm huggingface dataset:
npm package: @mrtian/form2yaml
Description: Form表单与YAML数据互转，支持注释、字段映射、校验等高级特性。来源至 form2yaml 只是转为了ts, 增加了类型定义
Author: mrtian
Latest version: 1.0.6

# Form2Yaml

- 该包来自 form2yaml，我只是做了 js 转 ts, 并增加了类型定义。

实现 Form 表单和 YAML 数据的高效转换。

![@mrtian/form2yaml](./assets/form2yaml.png)

## 功能亮点
- 保留 YAML 注释，结构与注释同步更新
- 支持表单 key 与 YAML key 映射（keyMap）
- 支持字段空值处理（emptyMode）
- 支持 YAML 数据校验（validate）
- 支持部分字段合并/忽略
- 基于 `js-yaml`、`lodash`、`async-validator` 实现

---

## 目录
- [安装](#安装)
- [快速上手](#快速上手)
  - [构造 Form2Yaml 对象](#构造-form2yaml-对象)
  - [keyMap 字段映射](#keymap-字段映射)
  - [获取全部数据](#获取全部数据)
  - [根据表单数据更新 YAML](#根据表单数据更新-yaml)
  - [空值保留/删除](#空值保留删除)
  - [setYaml 用法](#setyaml-用法)
  - [YAML 校验](#yaml-校验)
- [编译与发布](#编译与发布)
- [常见问题](#常见问题)
- [联系方式](#联系方式)

---

## 安装
```shell
npm install @mrtian/form2yaml
```

## 快速上手

### 构造 Form2Yaml 对象
```js
import Form2Yaml from '@mrtian/form2yaml';
const yaml = `
meta:
  name: test  # 注释
  namespace: default
`;
const form2Yaml = new Form2Yaml(yaml);
console.log(form2Yaml.getJson());
// 输出：{ meta: { name: 'test', namespace: 'default' } }
```

### keyMap 字段映射
```js
const yaml = `
meta:
  name: test  # 注释
  namespace: default
`;
const form2Yaml = new Form2Yaml(yaml, {
  keyMap: { name: 'meta.name' }
});
console.log(form2Yaml.getJson()); // { name: 'test' }
```

### 获取全部数据
```js
console.log(form2Yaml.getJson('all'));
// { name: 'test', meta: { namespace: 'default' } }
```

### 根据表单数据更新 YAML
```js
const yaml = `
meta:
  name: test  # 注释
  namespace: default
`;
const form2Yaml = new Form2Yaml(yaml);
form2Yaml.setJson({ meta: { name: 'newName' } });
console.log(form2Yaml.getYaml());
// meta:
//   name: newName  # 注释
//   namespace: default
```

### 空值保留/删除
```js
const yaml = `
meta:
  name: test  # 注释
  namespace: default
`;
const form2Yaml = new Form2Yaml(yaml, {
  emptyMode: { 'meta.namespace': 'retain' }
});
form2Yaml.setJson({ meta: { name: 'newName', namespace: undefined } });
console.log(form2Yaml.getYaml());
// meta:
//   name: newName  # 注释
//   namespace:
```

### setYaml 用法
```js
const yaml = `
meta:
  name: test  # 注释
  namespace: default
`;
const form2Yaml = new Form2Yaml(yaml);
const newYaml = `
meta:
  name: newName  # 注释
  namespace: default
`;
form2Yaml.setYaml(newYaml);
```

### YAML 校验
```js
const yaml = `
meta:
  name: test  # 注释
  age: NaN
`;
const form2Yaml = new Form2Yaml(yaml, {
  rules: { 'meta.age': [{ pattern: /^\d+$/, message: '年龄必须为数字' }] }
});
form2Yaml.validate().then(() => {
  console.log('校验通过');
}).catch(err => {
  console.log('校验失败', err);
});
```

---

## 编译与发布
```shell
npm run build   # TypeScript 编译
npm run publish # 发布到 npm
```

---

## 常见问题
- Q: 如何保留 YAML 注释？
  - A: 本库自动保留注释，无需额外配置。
- Q: 如何自定义字段映射？
  - A: 通过 options.keyMap 配置。
- Q: 如何校验 YAML？
  - A: 通过 options.rules 配置校验规则，调用 validate 方法。

## 联系方式
如有问题或建议，欢迎提 issue 或联系作者邮箱：**mrtian@foxmail.com**
npm package: @mrtnvh/github-api-ts
Description: GitHub REST API client on TypeScript
Author: @mrtnvh
Latest version: 0.2.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @mrtnvh/github-api-ts

TypeScript API client for GitHub API

> :warning: **Work in progress**  

## Summary

This API client is generated by transforming the [GitHub OpenAPI document](https://github.com/github/rest-api-description/tree/main/descriptions/api.github.com) into a TypeScript SDK using [OpenAPI Typescript Codegen](https://github.com/ferdikoomen/openapi-typescript-codegen/).
npm package: @mrtnvh/pwa-to-tauri
Description: CLI tool to wrap PWAs in Tauri desktop apps
Author: @mrtnvh
Latest version: 0.4.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @mrtnvh/pwa-to-tauri

> **Warning**
> This project is a proof of concept to show how to convert a PWA to a Tauri app. Currently, it only supports macOS.

## How to use

```bash
npx @mrtnvh/pwa-to-tauri
```

Enter the URL of the PWA you want to convert. The app will be created in `~/Applications/PWA Tauri Apps`

## Possible future improvements:
- [x] Support Mac
- [ ] Support Windows
- [ ] Support Linux

- [x] Node CLI
- [ ] Rust CLI

- [ ] Adblock
- [ ] Audit security risks

- [x] Single command with arguments
  - [x] manifest-url
  - [x] name
  - [x] start-url
  - [x] help
npm package: @mrtnvh/twitter-api-ts
Description: Twitter v2 API client on TypeScript
Latest version: 0.2.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# twitter-api-ts

TypeScript API client for Twitter API

> :warning: **Work in progress**  

## Summary

This API client is generated by transforming the [Twitter OpenAPI document](https://api.twitter.com/2/openapi.json) into a TypeScript SDK using [OpenAPI Typescript Codegen](https://github.com/ferdikoomen/openapi-typescript-codegen/).
npm package: @mrts/solid-toy1
Description: SolidJS component library solid-toy1
Author: mrts
Latest version: 0.1.3

# solid-components-starter

A starter for creating a Solid component library.

## Development

- Install dependencies:

```bash
npm install
```

- Run the playground:

```bash
npm run playground
```

- Run the unit tests:

```bash
npm run test
```

- Build the library:

```bash
npm run build
```
npm package: @mrtujiawei/bin
Description: 我的命令行工具
Author: 屠佳伟
Latest version: 1.3.24

# @mrtujiawei/bin

shell 工具

## server

```
Usage: t server [options]

静态文件服务，支持https，请求代理

Options:
  -s, --https            开启https (default: false)
  -p, --port <port>      监听端口号 (default: "3000")
  -d, --dir <directory>  项目根目录 (default: 当前目录)
  -t, --target <url>     代理目录地址
  --prefix <prefix>      需要代理的路径前缀 (default: "/api")
  --rewrite              是否移除前缀 (default: false)
  -h, --help             display help for command
```


## push-all

提交所有当前目录下的代码

```
push-all
```

## download-m3u8

下载 m3u8 及 ts 文件

```shell
# dir 下载目录
download-m3u8 {m3u8} [-dir {dir}]
```

## split-m3u8

```shell
# filename 不要带.mp4
split-m3u8 {filename}
```

## combine-m3u8

```shell
combine-m3u8 {filename} {port}
```
npm package: @mrtujiawei/node-utils
Description: node.js 相关的工具函数
Author: 屠佳伟
Latest version: 0.1.12

# @mrtujiawei/node-utils #

> node.js 相关的工具函数

[![npm version](https://img.shields.io/npm/v/@mrtujiawei/node-utils.svg?style=flat-square)](https://www.npmjs.org/package/@mrtujiawei/node-utils)
[![install size](https://packagephobia.com/badge?p=@mrtujiawei/node-utils)](https://packagephobia.com/result?p=@mrtujiawei/node-utils)
[![npm downloads](https://img.shields.io/npm/dm/@mrtujiawei/node-utils.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@mrtujiawei/node-utils)
[![issues](https://img.shields.io/github/issues/Mr-Promise/node-utils)](https://github.com/Mr-Promise/node-utils/issues)
[![forks](https://img.shields.io/github/forks/Mr-Promise/node-utils)](https://github.com/Mr-Promise/node-utils)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Mr-Promise/node-utils/pulls)
[![stars](https://img.shields.io/github/stars/Mr-Promise/node-utils)](https://github.com/Mr-Promise/node-utils)
[![license](https://img.shields.io/github/license/Mr-Promise/node-utils)](https://github.com/Mr-Promise/node-utils/blob/main/LICENSE)

<!-- 以下是自动生成的内容 -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Installing](#installing)
- [Usage](#usage)
  - [note: ESModule usage](#note-esmodule-usage)
- [Example](#example)
  - [request](#request)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Installing ##

Using npm:

```bash
$ npm install @mrtujiawei/node-utils
```

Using yarn:

```bash
$ yarn add @mrtujiawei/node-utils
```

## Usage ##

```javascript
const utils = require('@mrtujiawei/node-utils');
```
or

```javascript
const utils = require('@mrtujiawei/node-utils');
```

### note: ESModule usage ###

```javascript
import utils from '@mrtujiawei/node-utils';
```
or

```javascript
import utils from '@mrtujiawei/node-utils';
```

## Example ##

使用示例

### request ###

> 为了能够支持流，返回 `Promise<chunk[]>`

```javascript
import { request } from '@mrtujiawei/node-utils';

request(url);
```
npm package: @mrtujiawei/scripts
Description: 打包脚本
Author: tujiawei
Latest version: 0.0.20

# Scripts

## 命令

`t-scripts start` 在当前目录开启服务

`t-scripts build` 打包当前目录下的项目

`t-scripts build --lib` 打包当前目录下的库

## 约定配置

入口文件: `src/index`

静态目录: `public`

页面模板: `public/index.html`

输出目录: `dist/`

## 配置参数

打包相关的配置

> `package.json` 中 `"#buildConfig"`

```json
{
  "#buildConfig": {
    // 打包模式 默认 development
    "mode": "development",
    // 库名 打包库时必传
    "libName": "libName",
    // 输出目录 默认dist
    "outputPath": "dist"
  }
}
```

`postcss` `babel` 相关的转换配置

> `package.json` 中 "browserslist"

```json
{
  "browserslist": {
    "development": ["last 1 version"],
    "production": ["> 0.1%"]
  }
}
```
npm package: @mrtujiawei/web-utils
Description: web相关工具函数，只能在网页上使用的工具函数
Author: 屠佳伟
Latest version: 1.3.1

# @mrtujiawei/web-utils

## Demo

### Scroller

弹性滚动

> 垂直滚动

```css
/* style.css */
* {
  margin: 0;
  padding: 0;
  color: #fff;
}

.list {
  /* 必须 */
  height: 100vh;
  overflow: hidden;
}

.list-item {
  list-style: none;
  text-align: center;
  padding: 20px;
  margin-bottom: 1px;
  background: #008c8c;
}
```

```javascript
/* App.js */
import { memo, useEffect, useRef, useState } from 'react';
import './style.css';

const List = memo(() => {
  return Array.from({ length: 50 }, (_, i) => i).map((value) => (
    <li key={value} className="list-item">
      {value}
    </li>
  ));
});

function App() {
  const [translateY, setTranslateY] = useState(0);
  const contentRef = useRef();

  useEffect(() => {
    const scroller = new window.TWebUtils.Scroller(setTranslateY);
    const cancel = scroller.addEvent(contentRef.current);
    return () => cancel();
  }, []);

  return (
    <div className="list">
      <ul
        ref={contentRef}
        style={{
          transform: `translateY(${translateY}px) translateZ(0)`,
        }}
      >
        <List></List>
      </ul>
    </div>
  );
}

export default App;
```

> 水平滚动


```css
/* style.css */
* {
  margin: 0;
  padding: 0;
}

.list {
  display: flex;
  flex-wrap: nowrap;
  color: #fff;
}

.list-item {
  flex-shrink: 0;
  list-style: none;
  text-align: center;
  width: 100px;
  padding: 20px;
  margin-bottom: 1px;
  background: #008c8c;
}
```

```javascript
/* App.js */
import { memo, useEffect, useRef, useState } from 'react';
import { preventDefaultEvent } from '@mrtujiawei/web-utils';
import './style.css';

const List = memo(() => {
  return Array.from({ length: 50 }, (_, i) => i).map((value) => (
    <li key={value} className="list-item">
      {value}
    </li>
  ));
});

function App() {
  const [translateY, setTranslateY] = useState(0);
  const contentRef = useRef();

  useEffect(() => {
    const data = new window.TWebUtils.Scroller(setTranslateY);
    const touchStart = (e) => {
      const content = contentRef.current;
      const childNodes = content?.childNodes;
      const lastChild = childNodes[childNodes.length - 1];
      // 关键是计算这个 min 能够向左滚动的最小值
      const min =
        content?.clientWidth - lastChild.offsetLeft - lastChild.clientWidth;
      data.touchStart(e.changedTouches[0].pageX, min);
    };

    const touchMove = (e) => {
      data.touchMove(e.changedTouches[0].pageX);
    };

    const touchEnd = (e) => {
      data.touchEnd(e.changedTouches[0].pageX);
    };

    preventDefaultEvent();

    const wrapper = contentRef.current?.parentNode;
    wrapper.addEventListener('touchstart', touchStart);
    wrapper.addEventListener('touchmove', touchMove);
    wrapper.addEventListener('touchend', touchEnd);
  }, []);

  return (
    <ul
      className="list"
      ref={contentRef}
      style={{
        transform: `translateX(${translateY}px) translateZ(0)`,
      }}
    >
      <List></List>
    </ul>
  );
}

export default App;
```
npm package: @mrubiosan/context
Description: Context cancellation for long lived functions
Author: Marc Rubio
Latest version: 0.1.1

# Context
A *context* governs the lifespan of a task. It can be canceled at will, or automatically after a given deadline.
The task and any subtasks are notified when the context ends, allowing for clean shutdowns.

This is a subset of the [Go context](https://pkg.go.dev/context) package adapted to JavaScript and Promises.

## Usage Example

```typescript
import { RootContext } from '@mrubiosan/context'

function someAsyncOperation(ms: number): Promise<void> {
  return new Promise(resolve => {
    setTimeout(resolve, ms).unref()
  })
}

async function main() {
  const [ctx, cancel] = RootContext.withTimeout(1500)
  try {
    await ctx.race(someAsyncOperation(2000))
  } finally {
    cancel()
  }
}

main()

```
npm package: @mrunia/material-ui-codemod
Description: A codemod for converting 1.0.0-beta material-ui to 3.9.0 @material-ui
Author: runia1
Latest version: 1.0.1

## Setup & Run

```
npm install -g jscodeshift
npm install @mrunia/material-ui-codemod

jscodeshift -t <codemod-script> <path>
```

- Use the -d option for a dry-run and use -p to print the output for comparison


## Included Scripts

- #### imports.js
 
    - Updates import statements `from "material-ui"` to from `"@materilal-ui/core"`
    - Updates import statements `from "material-ui-icons"` to from `"@materilal-ui/icons"`
    - Updates prop names for components which used to use `onRequestClose` to `onClose`
        
        - For Example: Popover, Menu, Modal, Dialog, Drawer, etc,.
npm package: @mrvicadai/babel-preset-prettify-bucklescript
Description: ## Why?
Latest version: 1.0.4

# bs-prettify

## Why?

This tool is built so the javascript output from Bucklescript could be more
human-readable.

Ugly syntax such as:

```js
var task = /* record */ [/* data */ data, /* callback */ callback];
```

will be converted to:

```js
let task = {
  data: data,
  callback: callback
};
```

## Checklist

- [x] Convert record creation code to object.
- [x] Remove `/* () */0` filler
- [x] Convert record access code to object access code.
- [x] Convert `Curry` related code into uncurried code.
- [x] Remove `dll.length = (dll.length - 1) | 0;` cast
- [ ] Remove `String()` constructor.
- [ ] Convert `Belt.Option` related code to plain `undefined`.
- [ ] Create `Option.map` API in utils.
npm package: @mrvito/tinymce-4-snippet-plugin
Description: TinyMCE snippet plugin
Author: Vytautas Lozickas
Latest version: 1.0.5

# TinyMCE 4.x Snippet plugin
Plugin for simple multi level dropdown menu for inserting custom HTML or plain text into your editor.

This plugin supports ***TinyMCE 4.x***.

Older version of the plugin for **TinyMCE 3.x**: https://github.com/eduardstula/tinymce-simple-snippet.

## Screenshot
dropdown **multilevel menu**

![image](screenshot.png)

## Install
Install the package: `npm i @mrvito/tinymce-4-snippet-plugin`

Use:
* Require (`require('@mrvito/tinymce-4-snippet-plugin')` or `import '@mrvito/tinymce-4-snippet-plugin'`)

OR

* Include the `plugin.js` or `plugin.min.js` file into your project

## Configuration
- Add `snippet` to the *plugins* list
- Insert `snippet` button to the toolbar
- Assign snippet data to `snippet_list` parameter
```js
var snippet_data = [];

tinymce.init({
  selector: 'textarea',
  plugins: 'snippet',
  toolbar: 'snippet',
  snippet_list: snippet_data
});
```
## Data

Snippet data to be assigned to `snippet_list` parameter.
* `title` = menu item title
* `value` = HTML or plain text that will be inserted
* `items` = array of sub-menu items

```
...
snippet_list: [
  {
    title: "Czech Republic",
    value: "",
    items: [
      {
        title: "West Bohemia",
        value: "",
        items: [
          {
            title: "Mariánské Lázně",
            value: "City: Mariánské Lázně"
          },
          {
            title: "Plzeň",
            value: "City: Plzeň"
          },
          {
            title: "Karlovy Vary",
            value: "City: Karlovy Vary"
          }
        ]
      }
    ]
  }
]
...
```
## Callback

You can use a callback function:

* `onSelect` = callback function to be called when menu item is selected

```js
...
snippet_list: [
  {
    title: "Cities",
    value: "",
    items: [
      {
        title: "Pilsen",
        value: "49.746955, 13.377288",
        onSelect: function (item) {
          //menu item name => Pilsen
          console.log(item.title);
                
          //menu item value => 49.746955, 13.377288
          console.log(item.value);
        }
      }
    ]
  }
]
...
```

## Demo

See the demo.

https://www.eduardstula.cz/demo/tinymce-4-snippet-plugin/
npm package: @mrwaip/adapter-fastify
Description: Adapter for SvelteKit apps that generates a standalone Fastify server
Latest version: 0.0.1-next.1

# @mrwaip/adapter-fastify

## Usage

Install with `npm i -D @mrwaip/adapter-fastify`, then add the adapter to your `svelte.config.js`:

```js
/// file: svelte.config.js
import adapter from '@mrwaip/adapter-fastify';

export default {
	kit: {
		adapter: adapter(),
	},
};
```

## Other

All concepts are same like with [@sveltejs/adapter-node](https://kit.svelte.dev/docs/adapter-node)