open-index/open-npm huggingface dataset:
npm package: @foxar/strapi-blurhash
Description: A plugin that generates blurhash for your uploaded images
Author: Emil Petras
Latest version: 1.1.1

# Strapi plugin strapi-blurhash

A plugin for <a href="https://github.com/strapi/strapi">Strapi CMS</a> that generates blurhash for your uploaded images

## Installation

To install, run:

```bash
npm install strapi-blurhash
```

Open/create file `config/plugins.js`. Enable this plugin by adding:

```js
module.exports = {
    ...
    'strapi-blurhash': {
      enabled: true,
      config: {
        regenerateOnUpdate: true
      }
    },
  }
```

## How to generate blurhash for an image

In the Strapi Dashboard open Content Manager. Edit one collection/single type. Add or edit a Media field type and save the collection/single type.

## How to get blurhash

Target a Strapi REST API endpoint. For example:

```
localhost:1337/api/products?populate=Image.*
```

The response will be a JSON containing blurhash along with rest of the image data:

```js
{
  "data": [
    {
      "id": 6,
      "attributes": {
        "name": "Test",
        "createdAt": "2022-10-27T14:52:04.393Z",
        "updatedAt": "2022-10-28T09:58:22.238Z",
        "Image": {
          "data": {
            "id": 80,
            "attributes": {
              "name": "image.png",
              "alternativeText": "image.png",
              "caption": "image.png",
              "width": 960,
              "height": 168,
              "formats": {
                ...
              },
              "hash": "image_ed1fbcdba0",
              "ext": ".png",
              "mime": "image/png",
              "size": 4.63,
              "url": "/uploads/image_ed1fbcdba0.png",
              "previewUrl": null,
              "provider": "local",
              "provider_metadata": null,
              "createdAt": "2022-10-28T09:42:02.471Z",
              "updatedAt": "2022-10-28T09:42:02.471Z",
              "blurhash": "U{Nd,T?bof?u_Nxuj[x[objZayoe_Mxuj[x["
            }
          }
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "page": 1,
      "pageSize": 25,
      "pageCount": 1,
      "total": 1
    }
  }
}
```
npm package: @foxbit-group/rest-api
Description: Foxbit's API client
Author: foxbit
Latest version: 0.1.3

# Foxbit JavaScript/TypeScript SDK

This is the official SDK provided by Foxbit for interacting with our APIs using JavaScript or TypeScript.

## Prerequisites

Ensure your environment meets the following requirements before using the SDK:

### Environment

-   Node.js (version 14 or higher recommended)
-   NPM (comes bundled with Node.js)


### Language Level

-   ES5 (requires a Promises/A+ compatible library)
-   ES6 or higher (recommended)


### Module System Support

-   CommonJS
-   ES6 Modules


## Installation

Install the SDK using NPM:

```bash
npm install @foxbit-group/rest-api
```

## How to Use

To start using the SDK, simply import the desired module and call its methods:

```typescript
const { MarketDataApi } = require('@foxbit-group/rest-api');

// Create an instance of the API
const marketDataApi = new MarketDataApi();

// Make API calls
marketDataApi.listCurrencies()
  .then(response => {
    console.log('Currencies:', response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
```

## Authentication

For authenticated endpoints, you must instantiate a `Configuration` object with your API credentials and pass it to the desired API module:

```typescript
const { Configuration, TradingApi } = require('@foxbit-group/rest-api');

// Initialize the configuration with your API key and secret
const config = new Configuration({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
});

// Create an instance of the Trading API
const tradingApi = new TradingApi(config);

// Make authenticated API calls
tradingApi.createOrder({
  createOrderRequest: {
    side: "BUY",
    type: "MARKET",
    market_symbol: "btcbrl",
    quantity: "1",
  },
})
.then((response) => {
  console.log("Order created:", response.data);
})
.catch((error) => {
  console.error("Error:", error);
});
```

The SDK will automatically:

1.  Generate the current timestamp
2.  Create the request signature using your API secret
3.  Add the required headers to each request:
    -   `X-FB-ACCESS-KEY`: Your API key
    -   `X-FB-ACCESS-TIMESTAMP`: Current timestamp
    -   `X-FB-ACCESS-SIGNATURE`: Signature generated from your API secret

## Documentation for API Endpoints

You can find detailed documentation for each API endpoint in the [Foxbit API Documentation](https://docs.foxbit.com.br/rest/v3).

## About This SDK

This SDK was automatically generated using [OpenAPI Generator](https://openapi-generator.tech/).

----------

> **Note:** This SDK is actively maintained by the Foxbit team. For more information, visit [https://foxbit.com.br](https://foxbit.com.br).
npm package: @foxbox/adobe-bootstrap-dsp
Description: Bootstrap DSP for Adobe XD VSCode Extension
Author: Foxbox Digital
Latest version: 1.0.3

# Bootstrap DSP for the Adobe XD Extension for Visual Studio Code

![Bootstrap DSP for the Adobe XD Extension for VS Code, created by Foxbox Digital](https://cdn.sanity.io/images/4j183ajh/production/b0451c2ed326aa6662617b30a74b1f8d4af8d323-1920x838.png)

Make developing with Bootstrap 5 even easier by using our free design system package (DSP) for Visual Studio Code. Gain direct access to Bootstrap code snippets and documentation with Intellisense right in the VS Code editor. This allows you to stay in flow and focus on development, instead of switching between your editor and the docs.

[Learn more about the Bootstrap 5 DSP](https://foxbox.com/blog/adobe-xd-vs-code-bootstrap-dsp)

## Installing
To install Adobe Bootstrap DSP in your project, please run:

```
npm install @foxbox/adobe-bootstrap-dsp
```

## DSP Setup

- Install the [Adobe XD extension for VS Code](https://letsxd.com/vscode)
- Open the Adobe XD extension for VS Code (`Cmd+Opt+X` for Mac users) and select `Load package`.
- Navigate to your `node_modules` folder and load the `bootstrap-dsp` folder located inside `@foxbox/adobe-bootstrap-dsp` (DSPs contain a dsp.json file at the root level).
- Hit the `Start Editing` button
- Hit the `Finish Editing` button

With that a new build will be triggered and the `dist` folder will be updated

## Environment Setup

### HTML Webpage

- Change directory to `plainHTML-project`
- Open the `index.html` file in a browser

**Note:** refresh manually everytime you update the `index.html`

### Next/React Application

- Change directory to `next-project`
- Run `npm i` to install the dependencies
- Run `npm run dev`
- Open [http://localhost:3000](http://localhost:3000) on the browser

### Usage

For you to use the code snippets correctly, you have to install [react-bootstrap](https://react-bootstrap.github.io/) and import the corresponding component

#### Example

```js
import { Button } from 'react-bootstrap';

function HomePage() {
  return <Button variant="primary">Primary Button</Button>;
}

export default HomePage;
```

## Resources

- Bootstrap 5 UI Kit assets: [https://assets.adobe.com/public/4ed7617e-4c25-4294-6cc0-d240c39f8a7e](https://assets.adobe.com/public/4ed7617e-4c25-4294-6cc0-d240c39f8a7e)
- Adobe XD VSCode Extension documentation: [https://github.com/AdobeXD/design-system-package-dsp](https://github.com/AdobeXD/design-system-package-dsp)

## Created by Foxbox Digital
[Foxbox Digital](https://foxbox.com) is an award-winning digital product agency, headquartered in Chicago. We partner with clients ranging from Fortune 50 companies to high-growth startups and everyone in between to design, develop, and deliver successful digital experiences.
npm package: @foxderin/koishi-plugin-foxhelp
Description: Enhanced Help plugin for Koishi with advanced features: custom formatting, images, feedback system, statistics, pagination and more
Author: foxderin
Latest version: 0.0.3

# FoxHelp - 增强版帮助插件

一个为 Koishi 设计的功能强大的帮助插件，支持自定义格式、图片、反馈系统、统计信息和分页显示等高级功能。

## ✨ 主要功能

### 🎨 自定义格式化
- **格式模板**：支持为标题、描述、别名、用法、选项、示例、子命令和页脚设置自定义格式模板
- **动态变量**：模板中可使用 `{content}` 和 `{time}` 变量

### 🖼️ 图片支持
- **自定义图片**：为帮助信息添加自定义图片
- **图片后缀**：在图片后添加自定义文本

### 📊 统计功能
- **使用统计**：跟踪命令使用次数和涉及的命令数量
- **最后使用时间**：记录每个命令的最后使用时间

### 📄 分页显示
- **智能分页**：当命令数量较多时自动分页显示
- **自定义页面大小**：可配置每页显示的命令数量
- **分页导航**：提供上一页/下一页导航提示

### 💬 反馈系统
- **反馈选项**：用户可通过 `-f` 选项获取反馈信息
- **群组邀请**：支持显示群组邀请链接

## 🚀 使用方法

### 基本用法
```bash
foxhelp              # 显示所有可用命令
foxhelp <command>     # 显示特定命令的帮助
foxhelp -H            # 显示隐藏的命令和选项
foxhelp -p 2          # 显示第2页的命令列表
foxhelp -s 5          # 每页显示5个命令
foxhelp -f            # 显示反馈信息
```

### 高级选项
- `-H, --showHidden`: 显示隐藏的命令和选项
- `-p, --page <number>`: 指定页码
- `-s, --pageSize <number>`: 每页显示数量
- `-f, --feedback`: 提供反馈

## ⚙️ 配置选项

```yaml
# 基础配置
shortcut: true        # 是否启用快捷调用
options: true         # 是否为每个指令添加 -h, --help 选项

# 图片配置
customImage: "https://example.com/help.png"  # 自定义帮助图片URL
imageSuffix: "感谢使用！"                     # 图片后缀文本

# 反馈配置
feedback: true                               # 是否启用反馈功能
inviteGroup: "https://example.com/group"     # 邀请群组链接

# 统计配置
statistics: true      # 是否启用统计信息显示

# 分页配置
pagination:
  enabled: true       # 是否启用分页显示
  pageSize: 10        # 每页显示的命令数量

# 格式化配置
formatters:
  title: "🎯 {content}"                      # 标题格式
  description: "📝 {content}"               # 描述格式
  aliases: "🔗 {content}"                   # 别名格式
  usage: "💡 用法：{content}"               # 用法格式
  options: "⚙️ 选项：\n{content}"           # 选项格式
  examples: "📋 示例：\n{content}"          # 示例格式
  subcommands: "📂 子命令：\n{content}"     # 子命令格式
  footer: "⏰ 生成时间：{time}"              # 页脚格式
```

## 🌍 多语言支持

插件支持以下语言：
- 中文简体 (zh-CN)
- 中文繁体 (zh-TW)
- 英语 (en-US)
- 日语 (ja-JP)
- 法语 (fr-FR)
- 俄语 (ru-RU)
- 德语 (de-DE)

## 📈 统计信息显示

当启用统计功能时，帮助信息会显示：
- 总使用次数
- 涉及的命令数量
- 每个命令的使用统计

## 🔧 开发者信息

### 事件系统
插件提供以下事件：
- `foxhelp/command`: 命令帮助生成时触发
- `foxhelp/option`: 选项描述生成时触发

### 扩展模式
插件扩展了 Koishi 的模块声明，为命令和选项添加了额外的配置选项：
- `hideOptions`: 隐藏所有选项
- `hidden`: 在帮助菜单中隐藏
- `params`: 本地化参数

## 📄 许可证

MIT License

## 👨‍💻 作者

foxderin <admin@glassfoxowo.com>

## 🔗 链接

- [GitHub Repository](https://github.com/foxderin/foxhelp)
- [Issue Tracker](https://github.com/foxderin/foxhelp/issues)
npm package: @foxen/navigation
Description: Next.js navigation helpers for Foxen (headers, cookies, redirects, draft mode)
Latest version: 1.4.1

# @foxen/navigation

Next.js 16-style request helpers for Foxen.

- `headers()` / `cookies()` accessors with automatic dynamic rendering opt-in
- `draftMode()` preview toggles
- Redirect/interrupt helpers (`redirect`, `permanentRedirect`, `notFound`, etc.)
- Request-scoped async context bridging Foxen routes

```ts
import { headers, cookies, redirect } from '@foxen/navigation';

export async function GET() {
	const hdrs = await headers();
	const session = (await cookies()).get('session');
	if (!session) redirect('/login');
	return Response.json({ ok: true, forwardedFor: hdrs.get('x-forwarded-for') });
}
```

## Helper Parity

| Next.js API | Foxen helper | Status |
|-------------|--------------|--------|
| `import { headers } from "next/headers"` | `await headers()` | ✅ Supported (marks route dynamic) |
| `import { cookies } from "next/headers"` | `await cookies()` | ✅ Supported (returns mutable cookie store) |
| `import { draftMode } from "next/headers"` | `await draftMode()` | ✅ Supported (`enable()/disable()` mutate preview cookies) |
| `import { redirect } from "next/navigation"` | `redirect()` / `permanentRedirect()` / `temporaryRedirect()` | ✅ Supported (throws interrupt) |
| `import { notFound } from "next/navigation"` | `notFound()` | ✅ Supported |
| `import { unauthorized } from "next/navigation"` | `unauthorized()` | ✅ Supported |
| `import { forbidden } from "next/navigation"` | `forbidden()` | ✅ Supported |

> ℹ️ All helpers except the interrupt functions return a `Promise`. Always `await` `headers()`, `cookies()`, and `draftMode()` so Foxen can capture dynamic usage.

## Usage Notes

- `headers()` returns a read-only snapshot. Iterating or reading marks the handler as dynamic and sets the `x-foxn-dynamic` response header.
- `cookies()` exposes the Next.js-compatible cookie jar. Mutations update the outgoing response headers in the active request context.
- `draftMode()` resolves to `{ isEnabled, enable(), disable() }`, mirroring Next.js preview behavior.
- Redirect and status helpers throw typed interrupts; make sure the `foxnInterruptHandler` middleware is installed in custom Elysia apps.

## Migration

- Legacy helpers like `NextResponse.unauthorized()` and `NextResponse.forbidden()` from `@foxen/core` are deprecated. Call the corresponding interrupt helpers exported from `@foxen/navigation` instead for consistent handling across runtimes.
npm package: @foxford/babel-preset-react-app
Description: Preset babel for foxford js apps
Author: Foxford Co
Latest version: 2.1.0

[![Build Status](https://netology-group.semaphoreci.com/badges/babel-preset-react-app/branches/master.svg?style=shields&key=6e65aff2-b9d1-4986-a133-2469c79ef427)](https://netology-group.semaphoreci.com/projects/babel-preset-react-app)


# Babel preset for foxford js apps

Forked from [babel-preset-react-app](https://github.com/facebook/create-react-app/blob/master/packages/babel-preset-react-app/) v10.0.0

First, [install Babel](https://babeljs.io/docs/setup/).

Then install @foxford/babel-preset-react-app.

```sh
pnpm add @foxford/babel-preset-react-app --save-dev
```

Then create a file named `.babelrc` with following contents in the root folder of your project:

```json
{
  "presets": ["@foxford/babel-preset-react-app"]
}
```

This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](http://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.

## Usage with Flow

Make sure you have a `.flowconfig` file at the root directory. You can also use the `flow` option on `.babelrc`:

```json
{
  "presets": [["@foxford/babel-preset-react-app", { "flow": true, "typescript": false }]]
}
```

## Usage with TypeScript

Make sure you have a `tsconfig.json` file at the root directory. You can also use the `typescript` option on `.babelrc`:

```json
{
  "presets": [["@foxford/babel-preset-react-app", { "flow": false, "typescript": true }]]
}
```

## Absolute Runtime Paths

Absolute paths are enabled by default for imports. To use relative paths instead, set the `absoluteRuntime` option in `.babelrc` to `false`:

```
{
  "presets": [["@foxford/babel-preset-react-app", { "absoluteRuntime": false }]]
}
```

## Options
```js
type PresetOptions {
  absoluteRuntime: boolean,
  flow: boolean,
  typescript: boolean,
  debug: boolean,
  envUseBuiltIns: 'entry' | 'usage',
  presetEnvDisabled: boolean, // disable preset-env plugin
  targets: {}, // preset-env targets
  mjs: boolean, // esmodules targets for preset-env
  useESModules: boolean, // https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
  runtime: 'classic' | 'automatic' // use new jsx transform
}
```

## Plugins

```
  "@babel/plugin-proposal-class-properties"
  "@babel/plugin-proposal-decorators"
  "@babel/plugin-proposal-nullish-coalescing-operator"
  "@babel/plugin-proposal-numeric-separator"
  "@babel/plugin-proposal-optional-chaining"
  "@babel/plugin-transform-flow-strip-types"
  "@babel/plugin-transform-react-display-name"
  "@babel/plugin-proposal-export-default-from"
  "@babel/plugin-transform-runtime"
```
npm package: @foxford/docs-utils
Description: Foxford packages docs utils
Author: @foxford
Latest version: 0.3.0

| Command                      | Description                |
|-----------------------------:|:---------------------------|
| `npm test`                  | Run eslint check            |

## Getting started

1. `npm i`

## Usage

Inject ***styleguideConfigMixin*** into your `styleguidist.config.js` to get all the documentation components and styles.

```js
const { styleguideConfigMixin } = require('@foxford/foxford-docs-utils')

module.exports = {
  ...styleguideConfigMixin,
  /* If you want to have favicon, logo and images */
  assetsDir: resolve(__dirname, 'node_modules/@foxford/docs-utils/assets'),
  /** Your config here */
}
```

## Important documents

- [React-styleguidist](https://react-styleguidist.js.org/docs/getting-started)
- [Markdown cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
npm package: @foxford/pdf-generator
Description: React component for generate pdf on client from dom node
Latest version: 1.2.2

## Foxford PDF Generator

Генерация PDF документов на клиенте.
Используется для генерации сертификатов, дипломов, благодарственных писем.

| Command     | Description                                |
| ----------- | ------------------------------------------ |
| `npm start` | Запуск сервера для редактирования шаблонов |


Компонент `DocumentList` несёт в себе скрытую реализацию рендера списка документов, связанную непосредственно с библиотекой генерации. Его использование требует выполнения определенных условий, а именно:

- В случае использования нескольких `DocumentList` на странице требуется блокировка запросов на генерацию с разных экземпляров компонента.
  Для этого нужно использовать пропсы `onRequestGenerating`, `onStartGenerating`, `onEndGenerating` для установки/снятия флага, который будет проверяться в `onRequestGenerating`

- Функция `startGenerating` должна выстреливать экшен для загрузки данных выбранного для просмотра/генерации документа.
  Принимает ID в качестве аргумента.

- Загруженные данные выбранного документа должны попадать в `selectedDocumentData`

```javascript

class MyComponent extends Component {
  state = {
    isGenerating: false,
  }

  endGenerating = (generatedInfo) => {
    this.setState({ isGenerating: false })
  }

  startGenerating = (id) => {
    const { actions } = this.props

    this.setState({ isGenerating: true })

    actions.getUserCertificate(id) // загружаем выбранный документ в стор
  }

  requestGenerating = () => {
    if (this.state.isGenerating) { return false } // запрещаем генерацию

    return true // продолжаем генерацию
  }

  render() {
    const { document, list } = this.props // получаем данные выбранного документа и список документов

    return (
      <DocumentList
        selectedDocumentData={document.data}
        documents={list}
        onRequestGenerating={this.requestGenerating}
        onStartGenerating={this.startGenerating}
        onEndGenerating={this.endGenerating}
      />
    )
  }
}

```
npm package: @foxford/react-hls
Description: React component for HLS player
Author: PidginEnemy
Latest version: 2.3.0

# react-hls

HLS player for react applications. Demo [here](http://pidginenemy.github.io/react_hls/).

## Installation

    npm install --save react-hls

    cd node_modules/hls.js

    npm install

Hls.js library imports from original sources (src folder), that's why you need to install hls.js dependencies and add folder to babel-loader config as "include" argument in your webpack configuration. For more info see [babel-loader](https://github.com/babel/babel-loader)

    /node_modules\/hls\.js/

## Usage example
 ``` javascript
import React, { Component } from 'react';
import HLSPlayer from 'react-hls';
import 'react-hls/src/style.css'; // need to import basic styles
import 'react-hls/src/icons.css'; // need to import basic icons

class HLSPage extends Component {
  render() {
    const source = 'http://www.streambox.fr/playlists/test_001/stream.m3u8';

    return (
      <div>
        <HLSPlayer source={source} />
      </div>
    );
  }
}

export default HLSPage;
 ```

## Run example
 ```````
 
npm run example
 
 ```````

## Notes

Duration & volume controls made with rc-slider, see docs - https://github.com/react-component/slider
npm package: @foxglove/avl
Description: Adelson-Velsky-Landis (AVL) self-balancing binary trees in TypeScript
Author: Foxglove Technologies
Latest version: 1.0.0

# @foxglove/avl

> _Adelson-Velsky-Landis (AVL) self-balancing binary trees in TypeScript_

## Introduction

[AVL trees](https://en.wikipedia.org/wiki/AVL_tree) are self-balancing binary trees that are commonly used to implement sorted sets. In addition to the common insertion, deletion, and retrieval operations, this implementation also supports range queries, greater than, and less than searches.

## Usage

```Typescript
import { AVLTree } from "@foxglove/avl";

const tree = new AVLTree<number, string>();
tree.set(0, "zero");
tree.set(1, "1");
tree.set(1, "one");
tree.set(3, "three");
tree.set(2, "two");
tree.delete(0);
console.log(tree.has(0)); // false
console.log(tree.get(1)); // "one"
console.log(tree.size); // 3
console.log(tree.minEntry()); // [1, "one"]
console.log(tree.maxEntry()); // [3, "three"]
console.log(tree.findLessThan(2)); // [1, "one"]
console.log(tree.findGreaterThanOrEqual(2)); // [2, "two"]
tree.forEach((value, key) => console.log(value)); // "one" "two" "three"
tree.range(2, 3, (value, key) => console.log(value)); // "two" "three"
console.log(tree.pop()); // [3, "three"]
console.log(tree.shift()); // [1, "one"]
tree.clear();

// Use a custom comparator for non-Number keys
const bigintTree = new AVLTree<bigint, string>((a, b) => Number(a - b));
bigintTree.set(1n, "one");
```

## Alternatives

[avl](https://github.com/w8r/avl) - Optional support for duplicate keys, but return values can mutate after delete() calls, missing range query optimization, no find\[Less/Greater\]Than\[OrEqual\] queries, no iterators, and naming conventions do not follow ES6 container patterns.

## License

@foxglove/avl is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/cdr
Description: Common Data Representation serialization and deserialization library
Author: Foxglove Technologies
Latest version: 3.5.0

# @foxglove/cdr

> _Common Data Representation serialization and deserialization library_

[![npm version](https://img.shields.io/npm/v/@foxglove/cdr.svg?style=flat)](https://www.npmjs.com/package/@foxglove/cdr)

## Introduction

Common Data Representation (CDR) defines a serialization format for primitive types. When combined with an Interface Definition Language (IDL) it can be used to create complex types that can be serialized to disk, transmitted over the network, etc. while transparently handling endianness and alignment requirements. It's specified by https://www.omg.org/spec/DDSI-RTPS/2.3/PDF (chapter 10) and https://www.omg.org/cgi-bin/doc?formal/02-06-51.

XCDR implementation follows [DDS-XTypes V1.3 specification](https://www.omg.org/spec/DDS-XTypes/1.3/PDF).

CDR is found in OMG DDS (Data Distributed Service) implementations such as the Real-Time Publish Subscribe (RTPS) protocol. This is the wire protocol found in ROS2, and CDR is the default serialization format used in rosbag2.

## Usage

```Typescript
import { CdrReader, CdrSizeCalculator, CdrWriter } from "@foxglove/cdr";

const calc = new CdrSizeCalculator();
calc.int8();
calc.uint8();
calc.int16();
calc.uint16();
calc.int32();
calc.uint32();
calc.int64();
calc.uint64();
calc.float32();
calc.float64();
calc.string("abc".length);
calc.sequenceLength();
console.log(calc.size);

const writer = new CdrWriter();
writer.int8(-1);
writer.uint8(2);
writer.int16(-300);
writer.uint16(400);
writer.int32(-500_000);
writer.uint32(600_000);
writer.int64(-7_000_000_001n);
writer.uint64(8_000_000_003n);
writer.float32(-9.14);
writer.float64(1.7976931348623158e100);
writer.string("abc");
writer.sequenceLength(0);

const reader = new CdrReader(writer.data);
console.log(reader.int8());
console.log(reader.uint8());
console.log(reader.int16());
console.log(reader.uint16());
console.log(reader.int32());
console.log(reader.uint32());
console.log(reader.int64());
console.log(reader.uint64());
console.log(reader.float32());
console.log(reader.float64());
console.log(reader.string());
console.log(reader.sequenceLength());
```

## Alternatives

[jscdr](https://github.com/atolab/jscdr) - Does not support bigint, pre-allocated buffers, or buffer length calculations.

## License

@foxglove/cdr is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/crc
Description: Fast CRC32 computation in TypeScript
Author: Foxglove
Latest version: 1.0.1

# @foxglove/crc

Fast CRC32 computation in TypeScript

[![npm version](https://img.shields.io/npm/v/@foxglove/crc)](https://www.npmjs.com/package/@foxglove/crc) ![](https://img.shields.io/badge/dependencies-0-green)

## Introduction

A [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) (CRC) is a calculation used to detect errors in data transmission.

This library implements **CRC32**, the standard 32-bit CRC using the binary polynomial `0xEDB88320`. This is the same algorithm used in [PNG](https://www.w3.org/TR/2003/REC-PNG-20031110/#D-CRCAppendix), [zlib](https://refspecs.linuxbase.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/zlib-crc32-1.html), and other popular applications.

## Interface

The following functions are exported from this package:

```ts
function crc32Init(): number;
function crc32Update(prev: number, data: ArrayBufferView): number;
function crc32Final(prev: number): number;

function crc32(data: ArrayBufferView): number;
```

Note: Since the CRC algorithm works with unsigned data, the `crc32` and `crc32Final` functions always return **non-negative** numbers. For example, CRC32(0x01) returns 2768625435 rather than -1526341861.

## Usage

```ts
import { crc32 } from "@foxglove/crc";

const data = new Uint8Array(...);

const crc = crc32(data);
```

```ts
import { crc32Init, crc32Update, crc32Final } from "@foxglove/crc";

let crc = crc32Init();
while (/* more data available */) {
  crc = crc32Update(crc, data);
}
crc = crc32Final(crc);
```

## Benchmarks

This package achieves a >5x performance improvement over many other CRC packages, because of the multi-byte algorithms used (adapted from https://github.com/komrad36/CRC).

The following benchmarks were recorded on a MacBook Pro with an M1 Pro chip and 16GB of RAM. Each iteration ("op") is processing 1MB of data.

```
$ yarn bench
...
  crc:
    355 ops/s, ±0.56%     | 81.52% slower

  node-crc:
    376 ops/s, ±0.14%     | 80.43% slower

  crc-32:
    1 057 ops/s, ±0.16%   | 44.98% slower

  polycrc:
    327 ops/s, ±0.21%     | slowest, 82.98% slower

  this package:
    1 921 ops/s, ±0.18%   | fastest
```

## References

For further information about CRCs and their computation, see:

- https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks
- https://github.com/komrad36/CRC
- https://create.stephan-brumme.com/crc32/
- https://zlib.net/crc_v3.txt
- https://github.com/Michaelangel007/crc32
- https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-abs/06966aa2-70da-4bf9-8448-3355f277cd77

## License

@foxglove/crc is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/electron-socket
Description: Networking sockets for Electron apps
Author: Foxglove
Latest version: 2.1.1

# @foxglove/electron-socket

Networking sockets for Electron apps

[![npm version](https://img.shields.io/npm/v/@foxglove/electron-socket.svg?style=flat)](https://www.npmjs.com/package/@foxglove/electron-socket)

## Introduction

Raw sockets are not supported in browser contexts, even in Electron apps. To overcome this limitation, this package uses RPC between the Electron renderer context (referred to in this package as the "renderer" and in Electron documentation as "main world") and the preloader (referred to in Electron documentation as "isolated world" when running with `contextIsolation: true`) to expose TCP/UDP sockets and server classes in the renderer context. The API somewhat resembles `net.Socket`/`dgram.Socket` and `net.Server` from node.js, with Promise-based methods since these classes are built on asynchronous RPC.

## Usage

```ts
// preload.ts ////////////////////////////////////////////////////////////////
import { PreloaderSockets } from "@foxglove/electron-socket/preloader";

PreloaderSockets.Create();
```

```ts
// renderer.ts ///////////////////////////////////////////////////////////////
import { Sockets } from "@foxglove/electron-socket/renderer";

async function main() {
  const net = await Sockets.Create();

  const server = await net.createServer();
  server.on("connection", (client) => {
    client.write(new Uint8Array([42]));
  });
  server.listen(9000);

  const socket = await net.createSocket();
  socket.on("data", (data: Uint8Array) => console.log(`Server sent ${data}`));
  socket.connect({ port: 9000, host: "localhost" });
}

main();
```

## License

@foxglove/electron-socket is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Development

### Testing

A small example Electron app is provided in the [example](example) directory, which can be used for manual testing. Run it using `yarn example`.

### Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.