open-index/open-npm huggingface dataset:
npm package: @ifnot/fly-run
Description: Simple multiple process spawner and manager for developers.
Author: Anael Favre
Latest version: 1.0.3

# Fly Run

Simple multiple process spawner and manager for developers.

## Quick start

**1. Install** the package globally with npm or yarn:
  - `npm install -g @ifnot/fly-run`
  - (or) `yarn global add  @ifnot/fly-run`

**2. Configure** it with a js/json file (example `/home/me/fly-run.conf.js`) :

```js
module.exports = [
  {
    name: 'prog1',
    command: '/usr/bin/yarn',
    args: ['serve'],
    options: {
      cwd: '/home/me/projects/prog1',
    }
  },
  // Add more programs here
]
```

**3. Run** with configuration file as second argument `fly-run /home/me/fly-run.conf.js`

## Commands

Fly run will listen inputs for running some actions :

- **CTRL + C**: Kill all spawned processes and exit the program
- `kill prog1`: Kill the process prog1
- `start prog1`: Start the process prog1
- `restart prog1`: Restart the process prog1

## Configuration (for each entries)

- **name** `string`: The name of the program (used for display and control commands)
- **command** `string`: The command to run
- (optionnal) **args** `array[string]`: The array of arguments used for the [spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options) command
- (optionnal) **options** `array[mixed]`: The array of options used for the [spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options) command
- (optionnal) **every** `number`: Interval in seconds for running again this program
  - Only for self-closing programs, handy for running crons (eg. each minute with `every: 60`).
  
## Todo List :

- [ ] Major refactoring for splitting main features into modules
- [ ] Check for process before running it again with `start` command
npm package: @ifnot/fly-sync
Description: Realtime and cross-platform (Windows, Linux, OSX) files and folders synchronisation using NodeJs.  Ideal for developers who want source code synchronization between two machines.
Latest version: 0.0.1

# Fly Sync (daemon) `WIP`

Realtime and cross-platform (Windows, Linux, OSX) files and folders synchronisation using NodeJs. 
Ideal for developers who want source code synchronization between two machines.

*In short, it's like linux `rsync` but bilateral, cross-platform, real-time and websocket-based.*

> **WIP Warning** not fully battle-tested, this package may contain bugs, please do not use in production and backup your files regullary.

## Main features

- :v: **Easy** - NodeJs cli app for client and server with simple config.
- :zap: **Fast** - Good transfer speed with websocket stream :
  - Multiples small files (npm packages, long nested folders ...)
  - Big files (with file streaming)
- :bulb: **Flexible** - Multiple named folders to sync with regex exclusion

## Quick start

Install the package globally with npm or yarn:
- `npm global install @ifnot/fly-sync`
- (or) `yarn add -g @ifnot/fly-sync`

### Server

Copy and configure `config.server.json` and start your server :

    node index.js --config=/path/to/config.server.json

### Client

Copy and configure `config.client.json` and start your client :

    node index.js --config=/path/to/config.client.json

## Configuration

- **server** `boolean`: Tells the app to act as a server (`port` became required)
- **port** `numeric`: The port to use for the server
- **client** `boolean`: Tells the app to act as a client (`remote` became required)
- **remote** `string`: The complete WebSocket URL where the client should attempt to connect (example: `ws://127.0.0.1:6666`)
- **temp_path** `string`: The temporary folder to use for receiving file streams
- **paths** `array` : list of all paths to sync
  - **id** `string`: The id of the folder to sync (ids should match between server and client)
  - **path** `string`: The **absolute** path of the folder to sync
  - **only** `string`: The whitelist regex for filtering relative files paths
  - **except** `string`: The blacklist regex for filtering relative files paths

## Tech stack

- File change detection using a native C++ Node module for querying and subscribing to filesystem events. The same as [Parcel 2](https://parceljs.org/) with the [@parcel/watcher](https://www.npmjs.com/package/@parcel/watcher) package.
- Fast transfer with WebSocket client and server implementation [ws](https://www.npmjs.com/package/ws)

## Todo List :

- [ ] Add ping-pong strategy for :
  - [ ] Detecting lost clients from server
  - [ ] Reconnecting clients when connection is lost
- [ ] Improve the event ownership system for a hash based ?
- [ ] Add hashing and time based verification before doing disk actions
- [ ] Add an initial full folder sync on connection (what strategy ?)
- [ ] Add reading buffer for accepting multiple clients & servers (using a reading cache)
- [ ] Improve receiving message stream using real Stream
npm package: @ifonts/qiniu-file-upload
Description: qiniu file upload tool
Latest version: 1.1.2

# @ifonts/qiniu-file-upload

[![NPM version](https://img.shields.io/npm/v/@ifonts/qiniu-file-upload.svg?style=flat)](https://npmjs.com/package/@ifonts/qiniu-file-upload)
[![NPM downloads](http://img.shields.io/npm/dm/@ifonts/qiniu-file-upload.svg?style=flat)](https://npmjs.com/package/@ifonts/qiniu-file-upload)

This script uploads a directory of files to a specified Qiniu cloud storage bucket. It uses the qiniu library to handle the uploads and supports options for concurrency, ignoring specific files, and custom log handling.

## Prerequisites

- Node.js
- Qiniu account with access keys

## Install

```bash
$ npm install @ifonts/qiniu-file-upload
```

## Example

```Javascript
require('dotenv').config();
const path = require('path');
const { uploadDir } = require('./qiniu-upload');

uploadDir({
  dir: path.join(__dirname, './public/images'),
  keyPrefix: '/images',
  bucket: 'bucket-oss',
  accessKey: process.env.ACCESS_KEY,
  secretKey: process.env.SECRET_KEY
});
```

## Options

- `dir`: The local directory to upload.
- `bucket`: The target Qiniu bucket name.
- `keyPrefix`(optional): The prefix to prepend to all keys in the bucket.
- `accessKey`: Your Qiniu access key (optional if already configured).
- `secretKey`: Your Qiniu secret key (optional if already configured).
- `ignoreFilenames`(optional): Array of filenames to ignore during upload (default: [".DS_Store"]).
- `overwrite`(optional): boolean to force overwrite all files (default: false).
- `overwrites`(optional): Array of strings or regular expressions to force overwrite specific files when `overwrite` is false.
- `concurrency`(optional): Number of concurrent uploads (default: 6).
- `onLog`(optional): Callback function to handle log messages.
npm package: @iford/vue3-tags-input
Description: A tags input component for Vue 3 with autocompletion, custom validation, templating and much more
Author: Johannes Munari
Latest version: 1.0.2

# vue-tags-input

A tags input component for Vue 3 with autocompletion, custom validation, templating and much more

Forked from [@sipec/vue-tags-input](https://www.npmjs.com/package/@sipec/vue-tags-input), which you should use instead if your project is on Vue 2.

[Demo & Docs](http://www.vue-tags-input.com) (for the original version)

## Features

- No dependencies
- Custom validation rules
- Hooks: Before adding, Before deleting ...
- Edit tags after creation
- Fast setup
- Works with Vuex
- Small size: 34kb minified (css included) | gzipped 9kb
- Autocompletion
- Many customization options
- Own templates
- Delete tags on backspace
- Add tags on paste
- Examples & Docs

## Install

NPM

```
npm install @iford/vue3-tags-input
```

## Usage

```html
<template>
  <div>
    <vue-tags-input
      v-model="tag"
      :tags="tags"
      @tags-changed="newTags => tags = newTags" />
  </div>
</template>
```

```javascript
<script>
import VueTagsInput from "@sipec/vue3-tags-input";

export default {
  components: {
    VueTagsInput,
  },
  data() {
    return {
      tag: '',
      tags: [],
    };
  },
};
</script>
```

## Migration From Vue 2

This version is faithful to the original spec. The only thing you'll have to change is replacing any usages of `tags.sync` with `vmodel:tags` in the props

## License

[MIT](https://opensource.org/licenses/MIT)

Copyright (c) 2019 Johannes Munari
npm package: @ifraan_/pretty-ms
Description: Transform milliseconds to reading time.
Author: ifraan_
Latest version: 1.0.4

<div align="center">
    <h1>pretty-ms</h1>
    <a href="https://www.codefactor.io/repository/github/ifraan/pretty-ms"><img src="https://www.codefactor.io/repository/github/ifraan/pretty-ms/badge" alt="CodeFactor" /></a>
    <a href="https://www.npmjs.com/package/@ifraan_/pretty-ms"><img src="https://badgen.net/npm/v/@ifraan_/pretty-ms?color=blue" alt="NPM-Version"/></a>
    <a href="https://www.npmjs.com/package/@ifraan_/pretty-ms"><img src="https://badgen.net/npm/dt/@ifraan_/pretty-ms?color=blue" alt="NPM-Downloads"/></a>
    <a href="https://github.com/iFraan/pretty-ms"><img src="https://badgen.net/github/stars/iFraan/pretty-ms?color=yellow" alt="Github Stars"/></a>
    <a href="https://github.com/iFraan/pretty-ms/issues"><img src="https://badgen.net/github/open-issues/iFraan/pretty-ms?color=green" alt="Issues"/></a>
    <h2>A simple milliseconds to reading-time function</h2>
    <h3>There are no dependencies nor API key required.</h3>
</div>

## To install use:
```shell
npm i @ifraan_/pretty-ms
```
## Examples:

### Default
```js
const value = (1003 * 90 * 5 * 10 * 305) - 36000; // random ms
prettyMs(value)
// '15d 22h 23m 1s'
prettyMs(value, { verbose: true })
// '15 days, 22 hours, 23 minutes and 1 second'
```

### Compact
```js
const value = (1003 * 90 * 5 * 10 * 305) - 36000; // random ms
prettyMs(value, { compact: true })
// '15d'
prettyMs(value, { compact: true, verbose: true })
// '15 days'
prettyMs(value, { compact: true, colonNotation: true })
// '15:22:23:01'
```

### Sub Milliseconds
```js
const value = (1000 * 60) + 1500.660005; // random ms
prettyMs(value, { formatSubMilliseconds: true })
// '1m 1s 500ms 660µs 5ns'
prettyMs(value, { formatSubMilliseconds: true, verbose: true })
// '1 minute, 1 second, 500 milliseconds, 660 microseconds and 5 nanoseconds'
```

### Multiple languages
```js
prettyMs(value, { verbose: true, lang: 'en' }); // english
// '15 days, 22 hours, 23 minutes and 1 second'
prettyMs(value, { verbose: true, lang: 'es' }); // spanish
// '15 días, 22 horas, 23 minutos y 1 segundo'
prettyMs(value, { verbose: true, lang: 'pt' }); // portuguese
// '15 dias, 22 horas, 23 minutos e 1 segundo'
```
npm package: @iframe-player/provider
Description: iframe player provider
Author: greatbug
Latest version: 0.1.6

# iframe-player-provider

## 浏览器支持

IE9+

## 安装

在浏览器中使用：

```html
<body>

  <!-- 引入源文件 -->
  <script src="path/to/index.iife.min.js"></script>

  <script>
    var player = new IframePlayerProvider({
      // config
    });
  </script>
</body>
```

使用 npm：

```
npm install @iframe-player/provide --save
```

使用 yarn：

```
yarn add @iframe-player/provide
```

在 Node.js 中：

```javascript
// ESModule
import IframePlayerProvider from '@iframe-player/provider';

// CommonJS
var IframePlayerProvider = require('@iframe-player/provider/index.cjs.js');
```

## 初始化 & 配置

引入后, 需要初始化 IframePlayerProvider

```javascript
var player = new IframePlayerProvider(config);
```

`config` 是一个必填的 object 对象，具体配置如下：

```javascript
var config = {
  // video 元素
  $video: $video,

  // 父级页面的window对象
  targetWindow: window.parent,

	// video 元素 controls属性相关规则:
	// 1. 优先取决于配置项：controls=true ，video 增加 controls 属性；controls=false ，video 移除 controls 属性；
	// 2. 其次取决于 url search params：controls=0，移除 controls属性；
	// 3. 不满足以上情况，不做处理。
	controls: true,

  // 利用actions配置，能够覆盖插件原本的行为
  // 这个配置会覆盖 index.ts: playerActions 对象对应的方法
  // 如果没有自定义插件行为的需要，可以忽略这项配置
  actions: {
    getDuration() {
      // 将 getDuration 原本的逻辑复制过来，保证基础的交互行为
      this.postVideoMessage({
        eventType: "reply-get-duration",
        value: { seconds: this.config.$video.duration }
      });
      // 加入你的代码
    }
  }
};
```

## 更新日志

2021-09-11

- 增加对 video 元素 controls 属性的控制支持
- 优化内部命名
npm package: @iframe-player/user
Description: iframe player user
Author: greatbug
Latest version: 0.1.7

# iframe-player-provider

## 浏览器支持

IE9+

## 安装

在浏览器中使用：

```html
<body>

  <!-- 引入源文件 -->
  <script src="path/to/index.iife.min.js"></script>

  <script>
    var player = new IframePlayer({
      // config
    });
  </script>
</body>
```

使用 npm：

```
npm install @iframe-player/user --save
```

使用 yarn：

```
yarn add @iframe-player/user
```

在 Node.js 中：

```javascript
// ESModule
import IframePlayer from '@iframe-player/user';

// CommonJS
var IframePlayer = require('@iframe-player/user/index.cjs.js');
```

## 初始化 & 配置

引入后, 需要初始化 IframePlayer

```javascript
var player = new IframePlayer(config);
```

`config` 是一个必填的 object 对象，具体配置如下：

```javascript
var config = {
	// iframe 元素
	target: $iframe,
	// 播放器 url
	playUrl: '/player',
	// 是否显示播放器控件，默认为 true
	controls: true,
	// 是否自动播放，默认为 false
	autoPlay: false,
	// 是否允许静音自动播放，默认为 false
	allowMutedAutoPlay: false,
	// 播放器初始化超过多少毫秒，则认为初始化失败，触发 error 事件。当timeout不为大于0的数字时，认为无超时设置。默认为 undefined
	timeout: 0,
};
```
npm package: @ifrank/koishi-plugin-drift-bottle
Description: - [x] 支持**公共（跨群）瓶子池**和**群内瓶子池**   > 默认丢到公共池，加特定格式则丢到群内池   >   > 群内池只能在群内被捞出，公共池则可以在所有群被捞出   >   > 捞瓶子时将随机捞出群内池和公共池的瓶子   >   > 如：   >   > **丢个瓶子 xxx** ——  丢到公共池   >   > **丢个瓶子（xxx** —— 丢到群内池
Author: iFrank
Latest version: 2.0.0-dev.4

# 漂流瓶

- [x] 支持**公共（跨群）瓶子池**和**群内瓶子池**
  > 默认丢到公共池，加特定格式则丢到群内池
  >
  > 群内池只能在群内被捞出，公共池则可以在所有群被捞出
  >
  > 捞瓶子时将随机捞出群内池和公共池的瓶子
  >
  > 如：
  >
  > **丢个瓶子 xxx** ——  丢到公共池
  >
  > **丢个瓶子（xxx** —— 丢到群内池

- [x] 支持内容换行
- [x] 去除开头结尾的多余空格和空行
- [x] 支持管理员查询是谁丢的瓶子（防广告防滥用）
  > 群管理员回复需要删除的瓶子，回复内容为触发词： 谁丢的
- [x] 支持管理员删除瓶子
  > 群管理员回复需要删除的瓶子，回复内容为以下任意触发词：丢掉/删除/回收
- [x] 支持丢图片
  > 需要先发图片，然后手动回复，写上「丢个瓶子」
  >
  > 如：
  >
  > **USER：** [图片]
  >
  > 或
  >
  > **USER：**
  >
  >      [图片]
  >
  > 丢个瓶子
  >
  > **BOT：** 好啦
- [x] 网页控制台管理

## 已知问题

- 由于[ORM](https://github.com/shigma/minato)尚未支持随机函数`RANDOM() for SQLite / RAND() for MySQL`，捞瓶子只能直接调用Database Driver执行SQL语句，因此只写了SQLite和MySQL的执行，其他数据库下预期会出错，请勿使用。
- 丢图片目前无法跨平台使用
npm package: @ifrc-cbs/admin
Description: CBS Admin frontend React component
Author: Andrei Rusu
Latest version: 0.0.4

# CBS - Reporting
Standalone webapp running the Reporting bounded context in development mode. 
An NPM package will externally be published and added in the Navigation module, together with the rest of the bounded contexts. 

## Building and running 

#### Install dependencies
```sh 
$ npm install
```

#### Run locally
This will start a development server, using [Parcel bundler](https://parceljs.org/), a faster and no-config alternative to Webpack.

```sh 
$ npm start
```

#### Running NodeJS API server
The NodeJS API server (under development) provides a more fluent Restful API and also makes it much easier to write frontend end-to-end tests (using Nightwatch.js).
 
To start the server:
```sh
$ npm run node:server
``` 

## Development
...

## End-to-end Testing
This project has support for writing automated UI tests using [Nightwath.js](http://nightwatchjs.org) - an easy to use Node.js based end-to-end testing framework
using the Webdriver API or Selenium.

### Running the tests
The tests by default will run in Chrome (headless mode). Nightwatch will start/stop ChromeDriver automatically and also start/stop the 
Parcel development server and NodeJS API server as needed.

The NodeJS API server mocked the calls to the backend and returns JSON output directly, for convenience. 
```sh
$ npm test
```

### Writing tests
New UI tests should be added to `test/src`. For more information about writing tests using Nightwatch, please refer to the [Nightwath docs(http://nightwatchjs.org/guide).

## Troubleshooting build issues
__npm install fails__

Sometimes running `npm install` will fail with unexpected, inexplicable error conditions. The errors are mostly related to
`babel-cli` or `npm` itself. If this occurs, try the following:

1. open `package.json` and delete the line which contains the `@ifrc-cbs/common-react-ui` dependency (make sure to delete the comma 
which precedes it);
2. run `npm install`;
3. add the line containing the `@ifrc-cbs/common-react-ui` dependency back and run `npm install` again.

__Parcel bundler errors__

Sometimes, particularly when changes in external components occur, running the development server (with Parcel) can produce errors.
You can try:

1. remove the `.cache` folder (this is where Parcel keeps its data for faster processing)
2. restart `npm run dev` process.
npm package: @ifrc-cbs/reporting
Description: CBS Reporting frontend React component
Author: Andrei Rusu
Latest version: 0.0.4

# CBS - Reporting
Standalone webapp running the Reporting bounded context in development mode. 
An NPM package will externally be published and added in the Navigation module, together with the rest of the bounded contexts. 

## Building and running 

#### Install dependencies
```sh 
$ npm install
```

#### Run locally
This will start a development server, using [Parcel bundler](https://parceljs.org/), a faster and no-config alternative to Webpack.

```sh 
$ npm start
```

#### Running NodeJS API server
The NodeJS API server (under development) provides a more fluent Restful API and also makes it much easier to write frontend end-to-end tests (using Nightwatch.js).
 
To start the server:
```sh
$ npm run node:server
``` 

## Development
...

## End-to-end Testing
This project has support for writing automated UI tests using [Nightwath.js](http://nightwatchjs.org) - an easy to use Node.js based end-to-end testing framework
using the Webdriver API or Selenium.

### Running the tests
The tests by default will run in Chrome (headless mode). Nightwatch will start/stop ChromeDriver automatically and also start/stop the 
Parcel development server and NodeJS API server as needed.

The NodeJS API server mocked the calls to the backend and returns JSON output directly, for convenience. 
```sh
$ npm test
```

### Writing tests
New UI tests should be added to `test/src`. For more information about writing tests using Nightwatch, please refer to the [Nightwath docs(http://nightwatchjs.org/guide).

## Troubleshooting build issues
__npm install fails__

Sometimes running `npm install` will fail with unexpected, inexplicable error conditions. The errors are mostly related to
`babel-cli` or `npm` itself. If this occurs, try the following:

1. open `package.json` and delete the line which contains the `@ifrc-cbs/common-react-ui` dependency (make sure to delete the comma 
which precedes it);
2. run `npm install`;
3. add the line containing the `@ifrc-cbs/common-react-ui` dependency back and run `npm install` again.

__Parcel bundler errors__

Sometimes, particularly when changes in external components occur, running the development server (with Parcel) can produce errors.
You can try:

1. remove the `.cache` folder (this is where Parcel keeps its data for faster processing)
2. restart `npm run dev` process.
npm package: @ifrc-go/icons
Description: IFRC-GO icons library for React.
Author: samshara
Latest version: 2.0.1

## IFRC-GO Icons ![npm (scoped)](https://img.shields.io/npm/v/@ifrc-go/icons) [![Build](https://github.com/IFRCGo/go-icons/actions/workflows/ci.yml/badge.svg)](https://github.com/IFRCGo/go-icons/actions/workflows/ci.yml) [![Release & Publish](https://github.com/IFRCGo/go-icons/actions/workflows/release.yml/badge.svg)](https://github.com/IFRCGo/go-icons/actions/workflows/release.yml)
React icons for [IFRC-GO](https://github.com/IFRCGo/) project.

## Installation
```sh
yarn add @ifrc-go/icons
#or
npm install @ifrc-go/icons
```

## GitHub Pages
For local development
```
docker-compose up page-dev
```

For building the NextJS project
```
docker-compose up page-build
```

## Usage

Each icon can be imported as a react component.
```js
import { MenuLineIcon } from '@ifrc-go/icons';

function MyComponent() {
  return (
    <div>
      <MenuLineIcon className={{ color: #3b82f6 }} />
    </div>
  )
}
```
Each icon has its `stroke` and `fill` property set to `currentColor`.  The icon style can be set using the `color` CSS property.

## License

This library is MIT licensed.
npm package: @ifreeovo/track-client-sdk
Description: 自动上报埋点日志的sdk
Author: IFreeOvO
Latest version: 1.0.0

# @ifreeovo/track-client-sdk

![node](https://img.shields.io/badge/node->=18-brightgreen.svg)
![npm](https://img.shields.io/badge/pnpm->=8.0.0-blue.svg)
![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)
![download](https://img.shields.io/npm/dw/@ifreeovo/track-client-sdk)

自动上报埋点日志的客户端SDK，支持曝光和点击事件采集，提供数据验证功能。(需要配合[埋点后台](https://github.com/IFreeOvO/visual-event-tracking)使用)

## 功能特性

- 📊 自动采集页面曝光事件
- 🖱️ 自动采集元素点击事件
- 🔍 支持数据验证功能
- 🚀 支持多种上报方式（Beacon/Gif）
- 🔄 自动监听路由变化，加载当前路由埋点信息

## 用法

### 使用npm安装

```bash
npm install @ifreeovo/track-client-sdk
```

在`main.js`中引入：

```js
import Tracker from '@ifreeovo/track-client-sdk'
const tracker = new Tracker({
    serverURL: 'http://localhost:3000/api/v1',
    projectId: 1,
})
tracker.start()
```

### 使用cdn安装

```html
<script src="https://unpkg.com/@ifreeovo/track-client-sdk@1.0.0/dist/umd/index.umd.js"></script>
<script>
    const tracker = new __TRACK_CLIENT_SDK__({
        serverURL: 'http://localhost:3000/api/v1',
        projectId: 1,
    })
    tracker.start()
</script>
```

## 配置选项

- **serverURL** `{string}` [必填] - 埋点服务端地址，例如：`http://localhost:3000/api/v1`。用于请求页面的埋点配置。使用时注意跨域，建议后台开启cors
- **projectId** `{number}` [必填] - 项目ID，从埋点后台获取。用于请求页面的埋点配置
- **sendType** `{string}` [可选] - 上报方式，可选值：
    - `beacon` (默认) - 使用navigator.sendBeacon上报
    - `gif` - 使用图片打点上报
- **mode** `{string}` [可选] - 运行模式，可选值：
    - `report` (默认) - 仅上报数据。会将数据存入clickhouse
    - `validate` - 仅验证数据。数据仅通过postmessage传递给埋点后台进行验证，不会存储数据到数据库
    - `reportAndValidate` - 同时上报和验证数据
- **trackingClientURL** `{string}` [可选] - 埋点后台URL，用于postmessage跨域通信
- **accuracy** `{number}` [可选] - 验证标记精度，默认0.85。这个值越小，验证通过率越高，但是误报概率也会增大
- **intersectionObserverOptions** `{object}` [可选] - 曝光检测配置：
    - `threshold` - 曝光阈值(0-1)，默认0.5

## 埋点验证时，推荐配置

```js
const tracker = new __TRACK_CLIENT_SDK__({
    serverURL: 'http://localhost:3000/api/v1',
    projectId: 1,
    mode: 'validate',
    trackingClientURL: 'http://localhost:8000',
})
tracker.start()
```

埋点验证时，另外需要额外引入`@ifreeovo/track-link-sdk`包配合使用。埋点后台才能监控iframe路由变化。代码如下

```js
import SDK from '@ifreeovo/track-link-sdk'
SDK.init({
    trackingClientURL: 'http://localhost:8000',
})
```

## 生产环境，自动上报埋点推荐配置

```js
const tracker = new __TRACK_CLIENT_SDK__({
    serverURL: 'http://localhost:3000/api/v1',
    projectId: 1,
})
tracker.start()
```

## 开源许可证

[MIT](./LICENSE)
npm package: @ifreeovo/track-link-sdk
Description: ![node](https://img.shields.io/badge/node->=18-brightgreen.svg) ![npm](https://img.shields.io/badge/pnpm->=8.0.0-blue.svg) ![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg) ![download](https://img.shields.io/npm/dw/@ifreeovo/track-l
Author: IFreeOvO
Latest version: 1.0.0

# @ifreeovo/track-link-sdk

![node](https://img.shields.io/badge/node->=18-brightgreen.svg)
![npm](https://img.shields.io/badge/pnpm->=8.0.0-blue.svg)
![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)
![download](https://img.shields.io/npm/dw/@ifreeovo/track-link-sdk)

可视化埋点通讯SDK，提供DOM元素高亮、XPath生成、埋点截图、postmessage通讯和CDP协议通信功能。(需要配合[埋点后台](https://github.com/IFreeOvO/visual-event-tracking)使用)

## 功能特性

- 🔍 DOM元素高亮与检查
- 📝 自动生成元素XPath
- 🔗 基于CDP协议的通信能力
- 📱 支持iframe路由控制
- 🛠️ 自动截取埋点图片

## 安装

### 使用npm安装

```bash
npm install @ifreeovo/track-link-sdk
```

在`main.js`中引入：

```js
import SDK, { WS_FROM } from '@ifreeovo/track-link-sdk'

SDK.init({
    trackingClientURL: 'http://localhost:8000',
    socket: {
        devtoolURL: `ws://localhost:3000/api/v1/remote/devtool`,
        from: WS_FROM.CLIENT,
    },
})
```

## 配置选项

- **trackingClientURL** `{string}` [必填]  
  埋点客户端URL，用于postmessage跨域通信，例如：`http://localhost:8000`

- **socket** `{object}` [必填]  
  WebSocket连接配置：
    - `devtoolURL` - DevTool WebSocket服务地址，如：`ws://localhost:3000/api/v1/remote/devtool`
    - `from` - 客户端来源标识，使用`WS_FROM.CLIENT`常量

## 开源许可证

[MIT](./LICENSE)
npm package: @ifreeovo/translate-utils
Description: 翻译工具函数，支持有道，谷歌，百度，阿里机器翻译
Author: IFreeOvO
Latest version: 1.2.1

# @ifreeovo/translate-utils

一个翻译工具函数库。支持有道，谷歌。

## install

```
npm i @ifreeovo/translate-utils
```

## api

### googleTranslate

```ts
declare function googleTranslate(
  word: string, // 待翻译文本
  originLang: string, // 源语言
  targetLang: string, // 目标语言
  proxy: string | undefined // 代理地址
): Promise<string>
```

例子

```js
const res = await googleTranslate('翻译内容', 'zh-CN', 'en-US', 'socks://127.0.0.1:1080')
```

### youdaoTranslate

```ts
interface YoudaoConfig {
  key?: string // 有道词典appKey
  secret?: string // 有道词典appSecret
}

declare function youdaoTranslate(
  word: string, // 待翻译文本
  originLang: string, // 源语言
  targetLang: string, // 目标语言
  option: YoudaoConfig // 有道词典配置
): Promise<string>
```

例子

```js
const res = await googleTranslate('翻译内容', 'zh-CN', 'en-US', {
  key: '2d8e89a6fd072117',
  secret: 'HiX7rGmYRad3ISMLYexRLfpkJi2taMPh',
})
```