open-index/open-npm huggingface dataset:
npm package: @neosjs/electron-ipc
Description: electron-ipc
Author: 听着情歌流泪
Latest version: 3.2.2

# electron-ipc

## Usage

### Installation

```sh
npm i @neosjs/electron-ipc
```

## API

### Init

#### 主进程
```js
const { ipcMainManager } = request('@neosjs/electron-ipc')
```

#### 渲染进程进程
```js
import { nativeApi, downloaderApi, updaterApi, netApi, dbApi, ipcRendererManager } from '@neosjs/electron-ipc'
```
npm package: @neosjs/electron-localshortcut
Description: Electron LocalShortcut
Author: 听着情歌流泪
Latest version: 1.0.0

# Electron LocalShortcut

## 安装
![npm (scoped)](https://img.shields.io/npm/v/@neosjs/electron-localshortcut)

#### NPM
```sh
npm i @neosjs/electron-localshortcut -S
```
#### YARN
```sh
yarn add @neosjs/electron-localshortcut
```

## 使用
```js
const localShortcut = require('@neosjs/electron-localshortcut')

const win = new BrowserWindow()
win.loadUrl('https://www.xxxxxxxxxxx.com')
win.show()

// 注册快捷键
localShortcut.register(win, 'CmdOrCtrl+A', () => {
  console.log('你按下了 ctrl & A');
})

localShortcut.register(win, ['CmdOrCtrl+R', 'F5'], () => {
  console.log('你按下了 ctrl & R or F5');
})

// 取消注册
localShortcut.unregister(win, 'CmdOrCtrl+A')
```

## API 接口列表

- `localShortcut.register(win, accelerator, callback)`
- `localShortcut.unregister(win, accelerator)`
- `localShortcut.unregisterAll(win)`
npm package: @neosjs/electron-logger
Description: electron-logger
Author: 听着情歌流泪
Latest version: 1.0.2

# electron-logger

## Usage

### Installation

```sh
npm i @neosjs/electron-logger -S
```
```sh
yarn add @neosjs/electron-logger
```

## API

### Init

```js
const logger = require('@neosjs/electron-logger')
```
npm package: @neosjs/electron-sentry
Description: ...
Author: 听着情歌流泪
Latest version: 1.0.1

# `@neosjs/electron-sentry`

## Usage
### Installation
```sh
npm i @neosjs/electron-sentry
```

## API
### Init
```js
const {getSentryReport} =  require('@neosjs/electron-sentry')
const sentryReport = getSentryReport()
let config = { 
  dsn: '', 
  env: '', // default `development`
  version:'' // default `process.env.npm_package_version`
}
sentryReport.init(config)
```

### setUser
Set user information

```js
sentryReport.setUser(userInfo:<object>)
```
`userInfo` Identify: `id`, `username`, `email`, `ip_address`

### setTag
Tags are `key/value` string pairs that are both indexed and searchable. Tags power UI features such as filters and tag-distribution maps. Tags help you quickly access related events and view the tag distribution for a set of events. Common uses for tags include hostname, platform version, and user language.

```js
sentryReport.setTag(key:<string>,value:<string>)
sentryReport.setTag(content:<object>)
```

### setExtra
Set further extras

```js
sentryReport.setExtra(key:<string>,value:<string>)
sentryReport.setExtra(content:<object>)
```

### setContext
```js
sentryReport.setContext(key:<string>,value:<string>)
sentryReport.setContext(content:<object>)
```

### addBreadcrumb
Add a breadcrumb for events

```js
sentryReport.addBreadcrumb(category:<string>, message:<string>, level:<string>)
```
The level can be set to one of five values, which are, in order of severity: fatal, error, warning, info, and debug.error. default: info

### info
Another common operation is to capture a bare message. A message is textual information that should be sent to Sentry. Typically messages are not emitted, but they can be useful for some teams.

```js
sentryReport.info(message:<string>,level:<string>)
```

### error

In JavaScript, you can pass an error object to `error()` to get it captured as an event. It’s also possible to throw strings as errors, in which case no traceback can be recorded.

In JavaScript you can pass an error object to `error()` to get it captured as event. It's possible to throw strings as errors in which case no traceback can be recorded.

allow the following context keys to be passed: `tags`, `extra`, `contexts`, `user`, `level`, `fingerprint`.

```js
sentryReport.error(message:<string | object>,context:<object | function>)
```
eg:

```js
sentryReport.error(new Error("something went wrong"), {
  tags: {
    section: "articles"
  },
  user:{
    username:'xxxxxxx'
  }
})
```
npm package: @neosjs/electron-toolkit
Description: neosjs electron toolkit
Author: neosjs.com
Latest version: 1.0.1

# @neosjs/electron-toolkit

![Npm Version][npm-version-image] ![Npm Week Downloads][npm-downloads-image-week] ![Npm Month Downloads][npm-downloads-image-month] ![Minzip][minzip] ![License][license-image] ![Electron Toolkit][electron-toolkit]

Electron Toolkit

## 安装

```bash
pnpm add @neosjs/electron-toolkit

npm install @neosjs/electron-toolkit

yarn add @neosjs/electron-toolkit
```

## 使用

### 主进程

```js
import mainManager from '@neosjs/electron-toolkit/main'
```

### 渲染进程

```js
import rendererManager from '@neosjs/electron-toolkit/renderer'
```

## License

[MIT](./LICENSE) License © 2021-PRESENT [NeosJS](https://electron-toolkit.neosjs.com)

<!-- Badges -->

[npm-version-image]: https://img.shields.io/npm/v/@neosjs/electron-toolkit?style=flat&colorA=2d333b&colorB=1fa669
[npm-downloads-image-week]: https://img.shields.io/npm/dw/@neosjs/electron-toolkit?style=flatt&colorA=2d333b&colorB=1fa669
[npm-downloads-image-month]: https://img.shields.io/npm/dm/@neosjs/electron-toolkit?style=flat&colorA=2d333b&colorB=1fa669
[license-image]: https://img.shields.io/npm/l/@neosjs/electron-toolkit?style=flat&colorA=2d333b&colorB=1fa669
[minzip]: https://img.shields.io/bundlephobia/minzip/%40neosjs%2Felectron-toolkit?style=flat&colorA=2d333b&colorB=1fa669
[electron-toolkit]: https://img.shields.io/badge/NeosJS-electron--toolkit-1fa669?style=flat&colorA=2d333b&colorB=1fa669
npm package: @neosjs/electron-worker
Description: electron-worker
Author: 听着情歌流泪
Latest version: 1.1.0

# electron-worker

## Usage

### Installation

```sh
npm i @neosjs/electron-worker
```

## API

### Init

```js
const { getWorkerService } = require('@neosjs/electron-worker')
const workerService = getWorkerService(workerPath)
```

### start

```js
workerService.start()
```

### sendMessage

```js
workerService.send(message:<string|object>)
```

### onMessage

```js
workerService.on('message', data => {
  cpnsole.log(data)
})
```

### stop

```js
workerService.stop()

// kill child process
```
npm package: @neosjs/emitter
Description: 事件订阅/发布器，可实现多窗口同步消息
Author: 听着情歌流泪
Latest version: 1.0.3

<div align="center">

# @neosjs/emitter

简易的事件订阅/发布器，可实现多窗口同步消息

![Npm Version][npm-version-image] ![Npm Week Downloads][npm-downloads-image-week] ![Npm Month Downloads][npm-downloads-image-month] ![License][license-image] ![Emitter][emitter]

</div>

## 安装

```bash
pnpm add @neosjs/emitter

npm install @neosjs/emitter

yarn add @neosjs/emitter
```

## 使用

### 基础使用

```ts
import NeosEmitter from '@neosjs/emitter'

const emitter = new NeosEmitter()

// 订阅
emitter.on('test', (data) => {
  // …
})

// 发布
emitter.emit('test', 'hello world')
```

### 多窗口同步

```ts
import NeosEmitter from '@neosjs/emitter'

const emitter = new NeosEmitter({
  channelName: 'neosjs', // 通道名称(默认值：@neosjs-broadcast-emitterevent)
  broadcast: true, // 是否开启广播(多窗口同步消息)
  debug: true, // 是否开启调试(默认值：false)
})

// 窗口B订阅、监听事件
emitter.on('test', (data) => {
  // …
})

// 窗口A发布事件
emitter.emit('test', 'hello world')
```

## 参数

### `NeosEmitter(options: EmitterOptions)`

| 参数                  | 说明         | 类型             | 默认值                           |
| --------------------- | ------------ | ---------------- | -------------------------------- |
| `options`             | 配置项       | `EmitterOptions` | `{}`                             |
| `options.channelName` | 通道名称     | `string`         | `@neosjs-broadcast-emitterevent` |
| `options.broadcast`   | 是否开启广播 | `boolean`        | `false`                          |
| `options.debug`       | 是否开启调试 | `boolean`        | `false`                          |

## 方法

### `on(event: string, listener: Function)`

订阅事件

| 参数       | 说明       | 类型       |
| ---------- | ---------- | ---------- |
| `event`    | 事件名称   | `string`   |
| `listener` | 事件监听器 | `Function` |

### `once(event: string, listener: Function)`

订阅一次事件

| 参数       | 说明       | 类型       |
| ---------- | ---------- | ---------- |
| `event`    | 事件名称   | `string`   |
| `listener` | 事件监听器 | `Function` |

### `emit(event: string, data: any)`

发布事件

| 参数    | 说明     | 类型     |
| ------- | -------- | -------- |
| `event` | 事件名称 | `string` |
| `data`  | 事件数据 | `any`    |

### `off(event: string, listener?: Function)`

取消订阅事件

| 参数       | 说明       | 类型       |
| ---------- | ---------- | ---------- |
| `event`    | 事件名称   | `string`   |
| `listener` | 事件监听器 | `Function` |

### `destroy()`

销毁实例

## License

[MIT](./LICENSE) License © 2021-PRESENT [NeosJS](https://docs.neosjs.com)

<!-- Badges -->

[npm-version-image]: https://img.shields.io/npm/v/@neosjs/emitter?style=flat&colorA=2d333b&colorB=1fa669
[npm-downloads-image-week]: https://img.shields.io/npm/dw/@neosjs/emitter?style=flatt&colorA=2d333b&colorB=1fa669
[npm-downloads-image-month]: https://img.shields.io/npm/dm/@neosjs/emitter?style=flat&colorA=2d333b&colorB=1fa669
[license-image]: https://img.shields.io/npm/l/@neosjs/emitter?style=flat&colorA=2d333b&colorB=1fa669
[emitter]: https://img.shields.io/badge/NeosJS-emitter-1fa669?style=flat&colorA=2d333b&colorB=1fa669
npm package: @neosjs/eslint-config-neos
Description: NeosJS ESLint 配置规范
Author: 听着情歌流泪
Latest version: 1.0.0

# @neosjs/eslint-config-neos

> NeosJS ESLint 规则适用于 React/Vue/Typescript 项目的 ESLint 配置规范，而且也是你配置个性化 ESLint 规则的参考。

## 使用方法

### 内置规则
```sh
npm install --save-dev eslint babel-eslint @neosjs/eslint-config-neos
```
在你的项目的根目录下创建一个 .eslintrc.js 文件，并将以下内容复制进去：

```js
module.exports = {
  extends: [
    'neos',
  ],
  env: {
    // 你的环境变量（包含多个预定义的全局变量）
    //
    // browser: true,
    // node: true,
    // mocha: true,
    // jest: true,
    // jquery: true
  },
  globals: {
    // 你的全局变量（设置为 false 表示它不允许被重新赋值）
    //
    // myGlobal: false
  },
  rules: {
    // 自定义你的规则
  }
};
```
### Vue
```sh
npm install --save-dev eslint babel-eslint @neosjs/eslint-config-neos
```
在你的项目的根目录下创建一个 .eslintrc.js 文件，并将以下内容复制进去：

```js
module.exports = {
  extends: [
    'neos',
    'neos/vue',
  ],
  env: {
    // 你的环境变量（包含多个预定义的全局变量）
    //
    // browser: true,
    // node: true,
    // mocha: true,
    // jest: true,
    // jquery: true
  },
  globals: {
    // 你的全局变量（设置为 false 表示它不允许被重新赋值）
    //
    // myGlobal: false
  },
  rules: {
    // 自定义你的规则
  }
};
```
npm package: @neosjs/h5-camera
Description: NeosJS H5 Camera
Author: 听着情歌流泪
Latest version: 1.0.8

# H5 摄像机
 
## 安装
![npm (scoped)](https://img.shields.io/npm/v/@neosjs/h5-camera)

#### NPM
```sh
npm i @neosjs/h5-camera -S
```
#### YARN
```sh
yarn add @neosjs/h5-camera
```

## API 接口列表

- `camera.init(options: <Object>)` 
- `camera.startCapture(deviceId: <String>)`
- `camera.stopCapture()`
- `camera.changeDeviceId(deviceId: <String>)`
- `camera.getDeviceLists()`
- `camera.photoShot()`
- `camera.destroy()`
npm package: @neosjs/h5-graffiti
Description: NeosJS H5 Graffiti
Author: 听着情歌流泪
Latest version: 1.1.4

# H5 涂鸦

支持：画笔大小设置、橡皮擦大小设置、画笔颜色设置、撤销操作、打LOGO水印、生成图片、保存图片 等功能。

## 安装
![npm (scoped)](https://img.shields.io/npm/v/@neosjs/h5-graffiti)

#### NPM
```sh
npm i @neosjs/h5-graffiti -S
```
#### YARN
```sh
yarn add @neosjs/h5-graffiti
```

## API 接口列表

- `graffiti.init(object: <Object>)` 
- `graffiti.lineColor(color: <String>)`
- `graffiti.lineSize(size: <Number>)`
- `graffiti.eraserSize(size: <Number>)`
- `graffiti.eraser()`
- `graffiti.prev()`
- `graffiti.next()`
- `graffiti.clear()`
- `graffiti.destroy()`
- `graffiti.createImage()`
- ~~`graffiti.saveImage(fileName: <String>)`~~
npm package: @neosjs/h5-like
Description: NeosJS H5 like
Author: 听着情歌流泪
Latest version: 1.0.1

# 点赞

点赞动效。  
当点击按钮是，随机飘出设定的一组icon图片。

## 安装
![npm (scoped)](https://img.shields.io/npm/v/@neosjs/h5-like)
#### NPM
```sh
npm i @neosjs/@neosjs/h5-like -S
```
#### YARN
```sh
yarn add @neosjs/@neosjs/h5-like
```

## API 接口列表

- `like.init(object: <Object>)` 
- `like.destroy()`
npm package: @neosjs/h5-scroll
Description: NeosJS h5-scroll
Author: 听着情歌流泪
Latest version: 1.0.2

# 数字(图片)滚动

数字(图片)滚动动效。  

## 安装
![npm (scoped)](https://img.shields.io/npm/v/@neosjs/h5-scroll)
#### NPM
```sh
npm i @neosjs/h5-scroll -S
```
#### YARN
```sh
yarn add @neosjs/h5-scroll
```

## API 接口列表

- `scroll.init(options: <Object>)` 
- `scroll.start()` 

## 事件

- `scroll.on('start')` 
- `scroll.on('finished', data)`
npm package: @neosjs/merge-images
Description: 将多个图像合并成一个图像
Author: 听着情歌流泪
Latest version: 1.0.0

# @neosjs/merge-images

将多个图像合并成一个图像

## 安装

```bash
npm install @neosjs/merge-images
```

## 使用方法

```ts
import mergeImages from '@neosjs/merge-images'

const images = [
  'https://example.com/image1.png',
  'https://example.com/image2.png',
  'https://example.com/image3.png',
]

mergeImages(images, {
  width: 800,
  height: 600,
  format: 'image/png',
  quality: 1,
  crossOrigin: 'anonymous',
}).then((base64: string) => {
  console.log(base64)
})
```

## 参数

| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| :--- | :--- | :---: | :---: | :---: |
| images | 图像列表 | Array<Source | string> | - | - |
| options | 配置项 | Options | - | - |
| options.width | 合并后的图像宽度 | number | - | - |
| options.height | 合并后的图像高度 | number | - | - |
| options.format | 输出图像格式 | string | 'image/png'、'image/jpeg'、'image/webp' | 'image/jpeg' |
| options.quality | 输出图像质量 | number | 0 ~ 1 | 0.75 |
| options.crossOrigin | 跨域属性 | string | 'anonymous'、'use-credentials' | 'anonymous' |

## 接口类型

```ts
export interface Options {
  format?: string
  quality?: number
  width?: number | undefined
  height?: number | undefined
  Canvas?: any
  crossOrigin?: string
  Image?: any
  [key: string]: any
}
export interface Source {
  src?: string
  x?: number
  y?: number
  opacity?: number
}
```
npm package: @neosjs/pdf-viewer
Description: 基于Mozilla的PDFJS封装的Vue3 PDF预览器
Author: 听着情歌流泪
Latest version: 1.0.2

# @neosjs/pdf-viewer

![NPM Version][npm-version-image] ![Npm Week Downloads][npm-downloads-image-week] ![Npm Month Downloads][npm-downloads-image-month] ![License][license-image] ![PDF Viewer][pdf-viewer]

基于Mozilla的PDFJS封装的Vue3 PDF预览器

基本功能:

- 缩放
- 打开文件
- 打印
- 下载
- 旋转
- 文本选择
- 搜索

## 安装

```bash
pnpm add @neosjs/pdf-viewer

npm install @neosjs/pdf-viewer --save

yarn add @neosjs/pdf-viewer
```

## 使用

```vue
<template>
  <PdfViewer
    :pdf="pdf"
    :page-number="1"
    :config="config"
    file-name="PDF的名字"
    style="position: relative"
  />
</template>

<script lang="ts">
import PdfViewer from '@neosjs/pdf-viewer'
import '@neosjs/pdf-viewer/dist/index.css'

const pdf = ref('xxxxxx.pdf') // PDF文件的URL
const theme = ref('dark') // 主题颜色
const config = ref({
  secondaryToolbar: false, // 是否显示次要工具栏
  sidebar: false, // 是否显示侧边栏
  toolbar: {
    toolbarViewerLeft: { // 左侧工具栏, 如果不需要显示，可以设置为false
      findbar: true, // 搜索
      previous: true, // 上一页
      next: true, // 下一页
      pageNumber: true // 页码
    },
    toolbarViewerMiddle: { // 中间工具栏, 如果不需要显示，可以设置为false
      zoomOut: true, // 缩小
      zoomIn: true, // 放大
      scaleSelectContainer: false // 缩放选择
    },
    toolbarViewerRight: { // 右侧工具栏, 如果不需要显示，可以设置为false
      presentationMode: true, // 演示模式
      openFile: true, // 打开文件
      print: true, // 打印
      download: true, // 下载
    }
  }
})
</script>
```

## Props

| 名称        | 类型   | 默认值 | 说明          |
| ----------- | ------ | ------ | ------------- |
| pdf         | string | -      | PDF文件的URL  |
| page-number | number | 1      | PDF的初试页码 |
| page-scale  | number | 1      | PDF的缩放值   |
| config      | object | -      | PDF的配置     |
| file-name   | string | -      | PDF的名字     |
| theme       | string | dark   | 主题颜色      |

## Events

| 名称           | 说明         |
| -------------- | ------------ |
| after-created  | PDF创建完成  |
| open           | PDF打开完成  |
| pages-rendered | PDF渲染完成  |
| update-theme   | 主题颜色更新 |

## License

[MIT](./LICENSE) License &copy; 2021-PRESENT [NeosJS](https://docs.neosjs.com/)

[npm-version-image]: https://img.shields.io/npm/v/@neosjs/pdf-viewer?style=flat&colorA=2d333b&colorB=1fa669
[npm-downloads-image-week]: https://img.shields.io/npm/dw/@neosjs/pdf-viewer?style=flatt&colorA=2d333b&colorB=1fa669
[npm-downloads-image-month]: https://img.shields.io/npm/dm/@neosjs/pdf-viewer?style=flat&colorA=2d333b&colorB=1fa669
[license-image]: https://img.shields.io/npm/l/@neosjs/pdf-viewer?style=flat&colorA=2d333b&colorB=1fa669
[pdf-viewer]: https://img.shields.io/badge/NeosJS-pdf--viewer-1fa669?style=flat&colorA=2d333b&colorB=1fa669
npm package: @neosjs/pinia-sync-store
Description: 多窗口间 pinia store 共享数据
Author: 听着情歌流泪
Latest version: 1.0.4

# @neosjs/pinia-sync-store

![Npm Version][npm-version-image] ![Npm Week Downloads][npm-downloads-image-week] ![Npm Month Downloads][npm-downloads-image-month] ![Minzip][minzip] ![License][license-image] ![pinia sync store][pinia-sync-store]

多窗口间 pinia store 共享数据

## 安装

```bash
pnpm add @neosjs/pinia-sync-store

npm install @neosjs/pinia-sync-store

yarn add @neosjs/pinia-sync-store
```

## 使用

```ts
import type { App } from 'vue'
import { createPinia } from 'pinia'
import { createPiniaSyncStore } from '@neosjs/pinia-sync-store'

const store = createPinia()
const install = (app: App<Element>): any => {
  // 使用插件
  store.use(createPiniaSyncStore({
    enable: true, // 是否启用
    persist: false // 是否持久化
  }))
  app.use(store)
}
export { install, store }
```

## License

[MIT](./LICENSE) License © 2021-PRESENT [NeosJS](https://docs.neosjs.com)

<!-- Badges -->

[npm-version-image]: https://img.shields.io/npm/v/@neosjs/pinia-sync-store?style=flat&colorA=2d333b&colorB=1fa669
[npm-downloads-image-week]: https://img.shields.io/npm/dw/@neosjs/pinia-sync-store?style=flatt&colorA=2d333b&colorB=1fa669
[npm-downloads-image-month]: https://img.shields.io/npm/dm/@neosjs/pinia-sync-store?style=flat&colorA=2d333b&colorB=1fa669
[license-image]: https://img.shields.io/npm/l/@neosjs/pinia-sync-store?style=flat&colorA=2d333b&colorB=1fa669
[minzip]: https://img.shields.io/bundlephobia/minzip/%40neosjs%2Fpinia-sync-store?style=flat&colorA=2d333b&colorB=1fa669
[pinia-sync-store]: https://img.shields.io/badge/NeosJS-pinia--sync--store-1fa669?style=flat&colorA=2d333b&colorB=1fa669
npm package: @neosjs/request
Description: NeosJS Request
Author: 听着情歌流泪
Latest version: 2.1.0

# @neosjs/request

> 发起 HTTP、HTTPS 网络请求。（基于axios进行的二次封装）

## 使用方法

### request 用法

#### 基础使用

```js
import request from '@neosjs/request'

// 示例1

request({

url:'http://api.com',

params:{

user:1

}

}).then(res => {

console.log(res)

}).catch(err => {

console.log(res)

})



// 示例2

request('http://api.com',{

params:{

user:1

}

}).then(res => {

console.log(res)

}).catch(err => {

console.log(res)

})



// 示例3

request({

method:'POST',

url:'http://api.com',

params:{

user:1

},

// 发起请求之前的回调函数

before: () => {

console.log('before')

},

// 成功返回的回调函数

success: (res) => {

console.log(res)

},

// 接口调用失败的回调函数

fail: (err) => {

console.log(err)

},

// 接口调用结束的回调函数（调用成功、失败都会执行）

complete: () => {

console.log('complete')

}

})
```

#### async/await 用法

```js
import request from '@neosjs/request'

const res = await request({

url:'https://api.com',

params:{

id:1

}

})
```

### requestAll

```js
import { requestAll } from '@neosjs/request'

const requestA = await request({}) // 请求1

const requestB = await request({}) // 请求2

const res = requestAll([requestA,requestB])

console.log(res)
```

### requestInstance

```ts
import { requestInstance } from '@neosjs/request'

const data = await requestInstance.get('https://api.com',{
    // ....
})
const data = await requestInstance.post('https://api.com',{
    // ....
})
const data = await requestInstance({url:'https://api.com'})
```

> `requestInstance` 的使用方法，同 `axios` 一致。 请注意： 某些参数可能对 `requestInstance` 无效。

## 参数说明

| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| --------------- | ------------------------ | -------- | -------------------------------------- | ----- |
| url | 请求的api地址 | String | - | - |
| method | 请求类型 | String | POST、GET、DELETE、HEAD、OPTIONS、PUT、PATCH | GET |
| dataType | 返回数据类型 | String | - | json |
| timeout | 超时时间 | Number | - | 10000 |
| withCredentials | 是否传递cookie | Boolean | - | false |
| params | 请求的参数 | Object | - | - |
| retry | 重试次数 | Number | - | 1 |
| retryDelay | 重试间隔时间(ms) | Number | - | 2000 |
| cache | 是否开启缓存 | Boolean | - | true |
| cacheMaxAge | 缓存时间(ms) | Number | - | 60000 |
| forceUpdate | 是否强制更新缓存 | Boolean | - | false |
| cancelRequest | 是否取消重复请求 | Boolean | - | false |
| headers | 设置请求的 header | Object | - | {'Content-Type': 'application/json'} |
| before | 发起请求之前的回调函数 | Function | - | null |
| after | 请求完成后的回调函数 | Function | - | null |
| success | 成功返回的回调函数 | Function | - | null |
| fail | 接口调用失败的回调函数 | Function | - | null |
| complete | 接口调用结束的回调函数（调用成功、失败都会执行） | Function | - | null |
npm package: @neosjs/unplugin-build-message
Description: 打印编译信息到终端
Author: 听着情歌流泪
Latest version: 2.0.5

# @neosjs/unplugin-build-message

在终端打印出构建信息

## 安装

```sh
pnpm add @neosjs/unplugin-build-message -D

npm install @neosjs/unplugin-build-message -D

yarn add @neosjs/unplugin-build-message -D
```

## 使用方法

### Vite

```ts
// vite.config.ts

import buildMessage from '@neosjs/unplugin-build-message/vite'

export default defineConfig({
  plugins: [
    buildMessage({
      /* options */
    })
  ]
})
```

### Rollup

```ts
// rollup.config.js

import buildMessage from '@neosjs/unplugin-build-message/rollup'

export default {
  plugins: [
    buildMessage({
      /* options */
    })
  ]
}
```

### esbuild

```ts
// esbuild.config.js

import { build } from 'esbuild'

build({
  /* ... */
  plugins: [
    require('@neosjs/unplugin-build-message/esbuild')({
      /* options */
    }),
  ],
})
```
npm package: @neosjs/unplugin-imagemin
Description: 基于squoosh和sharp的图像压缩插件
Latest version: 0.0.2

# @neosjs/unplugin-imagemin

<a href="https://npmjs.com/package/@neosjs/unplugin-imagemin"><img src="https://badgen.net/npm/v/@neosjs/unplugin-imagemin" alt="npm package"></a> <a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/@neosjs/unplugin-imagemin" alt="node compatibility"></a>

## 安装

```bash
pnpm add @neosjs/unplugin-imagemin@latest -D
```

## 使用方法

### 基础使用

```ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ImageMin from '@neosjs/unplugin-imagemin/vite'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), ImageMin()],
})
```

### 高级使用

```ts
import path from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ImageMin from '@neosjs/unplugin-imagemin/vite'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    ImageMin({
      mode: 'squoosh',
      compress: {
        jpg: {
          quality: 10,
        },
        jpeg: {
          quality: 10,
        },
        png: {
          quality: 10,
        },
        webp: {
          quality: 10,
        },
      },
      conversion: [
        { from: 'jpeg', to: 'webp' },
        { from: 'png', to: 'webp' },
        { from: 'JPG', to: 'jpeg' },
      ],
    }),
  ],
})
```
npm package: @neosjs/videojs-player
Description: Neosjs Videojs Player
Latest version: 2.1.5

# @neosjs/videojs-player

Vue Videojs 播放器

## 示例

```vue
<NeosPlayer
id="VideoPlayer"
:class="['neosjs-player']"
:sources="sources"
:poster="poster"
v-model:volume="1"
v-model:muted="false"
:playbackRates="[0.5, 1, 1.5, 2, 2.5, 3]"
@ready="handlePlayerReady"
@dispose="handlePlayerDispose"
@mounted="handleMounted"
@unmounted="handleUnmounted"
@play="handleEvent($event)"
@pause="handleEvent($event)"
@ended="handleEvent($event)"
@loadeddata="handleEvent($event)"
@waiting="handleEvent($event)"
@playing="handleEvent($event)"
@canplay="handleEvent($event)"
@canplaythrough="handleEvent($event)"
@timeupdate="handleTimeupdateEvent(player?.currentTime())"
>    
</NeosPlayer>
```

```ts
const sources =  [
    // mp4格式
    { src: 'https://xxxxxxx.mp4', type: 'video/mp4' },
    // m3u8格式
    {
      src: 'https:/xxxxxxxx.m3u8',
      type: 'application/x-mpegurl'
    },
    // 音频
    {
      src: 'https:/xxxxxxxx.mp3',
      type: 'audio/mp3'
    }
]

const handleMounted = (payload: any) => {
    console.log('----播放器挂载完成', payload)
    state.value = payload.state // 播放器状态
    player.value = payload.player // 播放器实例
  }

  const handleUnmounted = () => {
    console.log('---播放器卸载')
  }

  const handlePlayerReady = (event: any) => {
    // player.value.currentTime(11) // 设置当前播放时长
    // player.value.poster('xxxxxxx') // 设置封面图
    console.log('---播放器准备完成', event)
  }

  const handlePlayerDispose = (event: any) => {
    console.log('---清除播放器', event)
  }
  const handleEvent = (event: any) => {
    console.log('---执行事件', event)
  }
  const handleTimeupdateEvent = (time?: number) => {
    console.log(`播放时长：${time}`)
  }
```
npm package: @neosjs/whiteboard
Description: whiteboard
Author: 听着情歌流泪
Latest version: 0.0.3

# @neosjs/whiteboard

![Npm Version][npm-version-image] ![Npm Week Downloads][npm-downloads-image-week] ![Npm Month Downloads][npm-downloads-image-month] ![Minzip][minzip] ![License][license-image] ![Eslint Config][eslint-config] ![Githu Ci][githu-ci]

_description_

## 安装

```bash
pnpm add @neosjs/whiteboard

npm install @neosjs/whiteboard

yarn add @neosjs/whiteboard
```

## License

[MIT](./LICENSE) License © 2021-PRESENT [NeosJS](https://docs.neosjs.com)

<!-- Badges -->

[npm-version-image]: https://img.shields.io/npm/v/@neosjs/whiteboard?style=flat&colorA=2d333b&colorB=1fa669
[npm-downloads-image-week]: https://img.shields.io/npm/dw/@neosjs/whiteboard?style=flatt&colorA=2d333b&colorB=1fa669
[npm-downloads-image-month]: https://img.shields.io/npm/dm/@neosjs/whiteboard?style=flat&colorA=2d333b&colorB=1fa669
[license-image]: https://img.shields.io/npm/l/@neosjs/whiteboard?style=flat&colorA=2d333b&colorB=1fa669
[minzip]: https://img.shields.io/bundlephobia/minzip/%40neosjs%2Fwhiteboard?style=flat&colorA=2d333b&colorB=1fa669
[eslint-config]: https://img.shields.io/badge/NeosJS-whiteboard-1fa669?style=flat&colorA=2d333b&colorB=1fa669
[githu-ci]: https://github.com/neosjs/whiteboard/workflows/CI/badge.svg
npm package: @neoskop/aviation-client
Description: ![Aviation](https://bytebucket.org/neoskop/aviation-client-typescript/raw/master/logo.png)
Author: Arne Diekmann
Latest version: 0.2.4

![Aviation](https://bytebucket.org/neoskop/aviation-client-typescript/raw/master/logo.png)

# Aviation Client for Typescript #

This library enables you to check against an [Aviation Server](https://bitbucket.org/neoskop/aviation) whether a feature is supposedly enabled or not.

## Usage ##

To add the library to your project:

```sh
$ yarn add @neoskop/aviation-client
```

To check for a feature:

```typescript
let client: AviationClient = aviation().endpoint('http://localhost:8080').token('sup3rs3cr3t').mix();

client.feature('test-feature-1').then(f => {
  if (f.evaluate()) {
    console.log('feature is enabled!');
  } else {
    console.log('feature is disabled!');
  }
}).catch((err) => {
  console.log('could not retrieve feature from server!', err);
});
```

## Test suite ##

To run integration tests in case you checked out the repository (awesome!):

```sh
$ docker pull neoskop/aviation:backend && docker-compose -f docker-compose.test.yml up --abort-on-container-exit --build
```
npm package: @neoskop/ethereal-secrets-client
Description: To add the library to your project:
Author: Arne Diekmann
Latest version: 5.0.0

# Ethereal Secrets Client

## Usage

To add the library to your project:

```sh
$ npm i --save @neoskop/ethereal-secrets-client
```

### Local Mode

to store a value `bar` under the key `foo` encrypted in the session storage:

```typescript
const client = new EtherealSecretsClient({
  endpoint: 'http://localhost:8080/secrets',
});
await client.saveLocal('foo', 'bar');
await client.getLocal('foo'); // => bar
await client.removeLocal('foo');
```

### Remote Mode

To store a value `bar` encrypted on the server:

```typescript
const client = new EtherealSecretsClient({
  endpoint: 'http://localhost:8080/secrets',
});
const result = await client.saveRemote('foo', 'bar');
await client.getRemote(result.fragmentIdentifier); // => bar
await client.removeRemote(result.fragmentIdentifier);
```

To use a second factor:

```typescript
const client = new EtherealSecretsClient({
  endpoint: 'http://localhost:8080/secrets',
});
const result = await client.saveRemote('foo', 'bar', { secondFactor: 'baz' });
await client.getRemote(result.fragmentIdentifier, { secondFactor: 'baz' }); // => bar
await client.removeRemote(result.fragmentIdentifier, { secondFactor: 'baz' });
```

## Test suite

To run integration tests in this repository:

```sh
$ docker-compose -f docker-compose.test.yml up --abort-on-container-exit --build
```
npm package: @neoskop/ethereal-secrets-middleware
Description: An express middleware to expose a REST endpoint to issue secrets for client to encrypt their local stores with (the so called local mode) or to store encrypted data for later retrieval (remote mode). The keys and the cipher texts are stored in a Redis DB.
Author: Arne Diekmann
Latest version: 5.0.0

# Ethereal Secrets Middleware

An express middleware to expose a REST endpoint to issue secrets for
client to encrypt their local stores with (the so called local mode) or
to store encrypted data for later retrieval (remote mode). The keys and
the cipher texts are stored in a Redis DB. Each entry in the database is
assigned a time-to-live thus making the secretes _ethereal_.

## Local mode

```typescript
let app = express();
app.use(
  '/secrets',
  etherealSecrets({
    local: {
      ttl: 15 * 60,
      cookie: {
        secret: 'icanhazcheezburger?',
      },
    },
    redis: {
      client: new IORedis(),
    },
  }),
);
```

If a client now issues `GET /secrets` the API will return JSON in the
form of:

```json
{
  "key": "<the key>"
}
```

Along with a cookie containing a session ID. On subsequent requests the
same key is returned as long as the session is valid and the same cookie
is sent with the request.

## Remote mode

```typescript
let app = express();
app.use(
  '/secrets',
  etherealSecrets({
    remote: {
      defaultTtl: 24 * 60 * 60,
    },
    redis: {
      host: 'redis',
    },
  }),
);
```

If a client issues `POST /secrets` with arbitrary data as post body
parameter `data`, the API will return status code 201 and JSON in the
form of:

```json
{
  "key": "<the key>"
}
```

If a client now accesses `GET /secrets/<the key>` the API will return
JSON in the form of:

```json
{
  "data": "<the data>"
}
```