open-index/open-npm huggingface dataset:
npm package: @genee/hci-socket
Description: ```typescript import HCISocket from '@genee/hci-socket';
Author: Jia Huang
Latest version: 1.1.1

# @genee/hci-socket

```typescript
import HCISocket from '@genee/hci-socket';

const sock = new HCISocket(0);
sock.bind('raw');
sock.on('data', (data) => {

});
sock.setopt(0, HCI_FILTER, filterBuffer);
```
npm package: @genee/i18n
Description: ```typescript import { setRemoteBase, setDefaultResources, useI18N } from '@genee/i18n';
Latest version: 1.2.4

```typescript
import { setRemoteBase, setDefaultResources, useI18N } from '@genee/i18n';

setDefaultResources({ key: 'TEXT' });
setRemoteBase('http://path/to/locale/base');

function Component() {
    const { T, locale } = useI18N();
    return <div>{T('hello.world')}</div>;
}
```
npm package: @genee/json-rpc
Description: ## Installation ```bash yarn add git+https://github.com/iamfat/json-rpc.git ```
Author: Jia Huang
Latest version: 1.10.6

# json-rpc

## Installation
```bash
yarn add git+https://github.com/iamfat/json-rpc.git
```

## Usage
### General
```typescript
import JsonRPC from '@genee/json-rpc'

const rpc = new JsonRPC(data => {
    // send your data with your customized function
}, {
    // logger?: console // you may customize your own logger 
})

rpc.receive(data) // process the data you received

rpc.on('xxx', () => {})
await rpc.call('xxx', params)
await rpc.notify('xxx', params)

rpc.setReady(false); 
rpc.setReady(true);

// get referenced functions and objects
const { functions, objects } = rpc.stat();
```

### SmartRPC
```typescript
import JsonRPC, { Smartify } from '@genee/json-rpc';

const SmartRPC = Smaritfy(JsonRPC);
const rpc = new SmartRPC(data => {
    // do your sending
})

rpc.setReady(false);
rpc.setReady(true);

rpc.whenReady(() => {
    // DO SOMEHTING WHEN RPC READY
});

rpc.whenNotReady(() => {
    // DO SOMEHTING WHEN RPC NOT READY
})

rpc.receive(data); // process data you received

await rpc.Namespace1.Namespace2.Method1('hello'); // == rpc.call('Namespace1.Namespace2.Method1', ['hello'])

```
npm package: @genee/modbus
Description: ## Usage
Latest version: 1.4.11

# @genee/modbus: A ModBus Library

## Usage

```javascript
const port = new SerialPort('/dev/ttyS0', {
    baudRate: 38400,
    autoOpen: false,
});

const bus = new ModBus({
    logger: console,
    write: (chunk) => {
        port.write(chunk);
    },
});

port.on('data', (chunk) => {
    bus.read(chunk);
});

const data = await bus.unit(0x33).readRegisters();

```
npm package: @genee/pico
Description: Light-weight AMD JS loader for specific scene.
Author: iamfat@gmail.com
Latest version: 2.0.0

# pico

Light-weight AMD JS loader for specific scene...

## Installation

```bash
pnpm add @genee/pico@^2
```

## How to use it?

```javascript
import { config, define, require } from 'pico';

config({
    paths: {
        'your-module-name': 'http://path/to/your-module.js',
    },
});

config({
    paths: (name) => {
        return `http://path/to/${name}`;
    },
});

define('YOUR_DEP_NAME1', YOUR_DEP_MODULE1);
define('YOUR_DEP_NAME2', YOUR_DEP_MODULE2);
// load some of your modules from browser-side
require(['url1', 'url2'], (module1, module2) => {

});
```
npm package: @genee/react-native-serialport
Description: ## Usage ```typescript import { RNSerialPort } from '@genee/react-native-serialport';
Latest version: 1.4.5

# @genee/react-native-serialport

## Usage
```typescript
import { RNSerialPort } from '@genee/react-native-serialport';

const port = RNSerialPort.openPort('/dev/ttyS0', 9600);
await port.write();

```
npm package: @genee/react-native-winuim
Description: ## Usage
Latest version: 1.2.5

# @genee/react-native-winuim

## Usage

```typescript
import Scanner from '@genee/react-native-winuim';

const bitmap = await Scanner.captureFinger();
const feature = await Scanner.detectFinger();

await Scanner.enrollFinger({
    timeout: 15000,
    update: ({ index, image }) => {
        // image is a blob url
        img.src = image;
    },
});

const score = await Scanner.verifyFinger(feature, template);
const scores = await Scanner.identifyFinger(feature, templates, 0.9);
```
npm package: @genee/rest
Description: ## Usage
Latest version: 1.4.3

# @genee/rest

## Usage

```typescript
import REST from '@genee/rest';

type UserData = {
    id: number;
    name: string;
};

class UserService extends REST {
    private token: string;

    construct() {
        super('https://host/base/url/api');
    }

    // will be called only once before the very first request
    protected async init() {
        // you have to use rawRequest
        this.token = await this.rawRequest(this.url('v1/token'));
    }

    // pass inited token to headers in each request
    protected get additionalHeaders() {
        return {
            Authorization: `Bearer ${this.token}`;
        }
    }

    // or pass inited token to queries in each request
    protected get additionalQueries() {
        return {
            token: this.token;
        }
    }
}

(async () => {
    const gateway = new REST('https://host/base/url/api');
    const user = await gateway.post<UserData>('v1/user', {
        name: 'Doe John'
    });
})();
```
npm package: @genee/struct
Description: C-like struct for buffer parsing and packing
Author: iamfat@gmail.com
Latest version: 1.1.2

# struct

A C-like struct library for buffer parsing and packing

## Usage

```typescript
import { struct, int16_t, uint16_t, uint8_t, LE, UINT16_MAX, INT16_MIN } from '../../lib/struct';

const SENSOR = struct({
    manufacturer: uint16_t,
    version: uint8_t,
    modeAndModel: uint8_t,
    mac: uint8_t[6],
    temperature: LE(int16_t),
    humidity: LE(uint16_t),
    pressure: LE(int16_t),
    flag: uint8_t,
    gasType: uint8_t,
    gasValue: LE(int16_t),
    gasScale: uint8_t,
    adValue: LE(uint16_t),
    battery: uint8_t,
});

const parsed = SENSOR.parse(binaryData);

parsed.humidity = 16;
const newBuf = SENSOR.update({ version: 1 }).pack(parsed);
```
npm package: @genee/theme-vars
Description: ## Installation
Latest version: 1.7.4

# @genee/theme-vars 给 React 框架提供动态换主题的操作

## Installation

```bash
yarn add @genee/theme-vars
```

## Usage

### 在开发的时候使用下面类似的配置来打包 antd

```javascript
// config-overrides.js
import { override, addBabelPlugins, addLessLoader } from 'customize-cra';
import { webpackThemeVars: themeVars } from '@genee/theme-vars/dev';

const modifyVars = {
    'primary-color': '#2b9f7f',
};

module.exports = {
    webpack: override(
        addLessLoader({
            lessOptions: {
                javascriptEnabled: true,
                modifyVars,
            },
        }),
        themeVars([
            {
                library: 'antd',
                followedVars: ['primary-color'],
                modifyVars,
            },
        ]),
    ),
};
```

### 在使用的时候

```javascript
import { setVars } from '@genee/theme-vars';

(async () => {
    await setVars({
        'antd-primary-color': '#2b9f7f',
        antdPrimaryColor: '#2b9f7f',
        antd_primary_color: '#2b9f7f',
    });
})();
```

> 键值用什么拼写方式都可以, 最后会转换成 xxx-xxx-xx 的方式
npm package: @genee/uno-dev
Description: ## 1. 整合方法
Author: jia.huang@geneegroup.com
Latest version: 1.0.9

# Uno Dev Env

## 1. 整合方法

```typescript
// 在项目的vite.config.ts
import { createUnoEnv } from "@genee/uno-dev/vite";

export default defineConfig({
  base: process.env.NODE_ENV === "production" ? "./" : "",
  plugins: [
    // inspect(),
    createUnoEnv("main.tsx", {
      gateway: "http://uno.dev.gapper.in/gapper/gateway",
      clientId: "CLIENT_ID",
      clientSecret: "CLIENT_SECRET",
      username: "UNO_USERNAME",
      password: "UNO_PASSWORD",
      params: {
        colors: {
          primaryColor: "#336699",
        },
      },
    }),
  ],
});
```
npm package: @genee/uno-webview
Description: 基于 iframe 的父窗口和子窗口的通讯机制实现，支持 React 和 Vue 3。
Latest version: 1.15.0

# @genee/uno-webview

基于 iframe 的父窗口和子窗口的通讯机制实现，支持 React 和 Vue 3。

## 安装

```bash
npm install @genee/uno-webview
```

## 使用方式

### React Hooks (默认)

```typescript
import { useUno, useUnoParams, useUnoGlobals } from '@genee/uno-webview';

function MyComponent() {
    const uno = useUno();
    const params = useUnoParams();
    const globals = useUnoGlobals();

    // 事件订阅
    useUnoEvent('customEvent', (data) => {
        console.log('Received event:', data);
    });

    // 方法创建
    useUnoMethod('customMethod', (param) => {
        console.log('Method called with:', param);
        return 'response';
    });

    // 使用逻辑
    return <div>Hello World</div>;
}
```

### Vue 3 Composition API

```typescript
import { useUno, useUnoParams, useUnoGlobals, useUnoEvent, useUnoMethod } from '@genee/uno-webview/vue';

export default {
    setup() {
        const uno = useUno();
        const params = useUnoParams();
        const globals = useUnoGlobals();

        // 事件订阅
        useUnoEvent('customEvent', (data) => {
            console.log('Received event:', data);
        });

        // 方法创建
        useUnoMethod('customMethod', (param) => {
            console.log('Method called with:', param);
            return 'response';
        });

        return { uno, params, globals };
    },
};
```

### 显式导入 React 模块

```typescript
import { useUno, useUnoParams, useUnoGlobals } from '@genee/uno-webview/react';
```

## API 参考

### 核心函数

#### `useUno()` / `getUno()`

获取 Uno 实例，用于与父窗口通信。

#### `useUnoParams(keys?: string[])`

获取响应式参数。

-   **React**: 返回 `Record<string, any>` 或 `any[]`
-   **Vue**: 返回 `Ref<Record<string, any>>` 或 `Ref<any[]>`

#### `useUnoGlobals(keys?: string[])`

获取响应式全局状态。

-   **React**: 返回 `Record<string, any>` 或 `any[]`
-   **Vue**: 返回 `Ref<Record<string, any>>` 或 `Ref<any[]>`

#### `useUnoEvent(event: string, handler: Function)`

订阅事件，组件卸载时自动取消订阅。

#### `useUnoMethod(method: string, handler: Function)`

创建方法，组件卸载时自动销毁。

## 类型支持

本库提供完整的 TypeScript 类型定义，支持 React 和 Vue 3 的类型推断。

## 兼容性

-   React 18+
-   Vue 3.0+
-   TypeScript 4.5+
npm package: @geneecode/geneeui
Description: GeneeUI is a React based component library, providing everyday use components for building web applications
Author: geneecode.com
Latest version: 1.0.5

<p align="center">
  <a href="https://geneecode.com/geneeui">
    <img src="http://geneecode.com/geneeui.png" alt="GeneeUI" width="600" />
  </a>
</p>




![Build](https://img.shields.io/badge/build-passing-brightgreen)
![Test](https://img.shields.io/badge/test-passing-success)
![Coverage](https://img.shields.io/badge/coverage-94-green)
![NPM](https://img.shields.io/badge/npm-1.0.4-blue)
![Dependencies](https://img.shields.io/badge/dependencies-uptodate-yellow)
![Dev Dependencies](https://img.shields.io/badge/devDependencies-uptodate-yellow)
![Storybook](https://img.shields.io/badge/storybook-deployed-orange)
![Liscense](https://img.shields.io/github/license/geneecode/geneeui)
![Stars](https://img.shields.io/github/stars/geneecode/geneeui)
![Issues](https://img.shields.io/github/issues/geneecode/geneeui)
![Forks](https://img.shields.io/github/forks/geneecode/geneeui)



# GeneeUI
This is a React based implementation of Component Library. This project is actively being developed, so expect changes/additions. The basic usage is outlined below.

## Checkout Storybook at 
<a href="http://geneecode.com/geneeui" target="_blank" >Goto GeneeUI</a>

## Usage
First install the library
```sh
npm i @geneecode/geneeui 
```

To add the styling you need to add the provided css file. How to import this varies based on your build pipeline. As an example for a simple CRA app, you would do the following:

```ts
import '@geneecode/geneeui/dist/geneeui.min.css';
```

After this you can import and use the components. The recommended way is to include individual components from the lib folder to reduce bundle size and allow for tree-shaking. If your pipeline allows import `esnext` or `esm` modules then see the example after this.

```tsx
import React from 'react';
import Button from '@geneecode/geneeui/lib/Button';

const App: React.FC = () => {
  return (
    <div>
      <Button>Button</Button>
    </div>
  );
}

export default App;
```

We also provide `esm` and `esnext` builds in `lib/esm` and `lib/es` folders respectively. You may use these if your pipeline allows.

```ts
import Button from '@geneecode/geneeui/lib/esm/Button';
// or
import Button from '@geneecode/geneeui/lib/es/Button';
```

### Development
```sh
# Build
npm run build

# Test
npm run test
npm run test:watch

# Storybook
npm run storybook
```
npm package: @genehack/my-eleventy-config
Description: modular, configurable, reusable config for TypeScript-based 11ty sites
Author: John SJ Anderson
Latest version: 1.0.0

# my-eleventy-config

A modular, configurable, reusable configuration for [11ty][]-based
websites that use TypeScript for configuration.

## how to use this package

See [11ty's TypeScript docs][] on how to use a TypeScript-based
configuration file for your 11ty site, then:

1. In your individual site, add this package as a dependency:

   ```bash
   npm i --save @genehack/my-eleventy-config
   ```

   In your site's `eleventy.config.ts` file, import the module,
   override any of the default configuration values you'd like to
   change (see below for what those defaults are), and in the first
   line of the default export, load the plugin with a spread version
   of your config overrides and the `intermediate: true` flag:

   ```typescript
   import eleventy from "@11ty/eleventy";
   import myConfig from "@genehack/my-eleventy-config";

   const myConfigConfig = {
     enableCssMinimization: false,
     passthrough: {
       dirs: ["fonts"],
       files: [],
     },
   };

   export default async function (config: eleventy.LocalConfig): Promise<void> {
     await config.addPlugin(myConfig, { ...myConfigConfig, immediate: true });

     // rest of your custom config goes here…
   }
   ```

## default configuration

By default, the plugin provides this configuration:

```javascript
{
  enableCssMinimization: true,
  enableDrafts: true,
  enableImageOptimization: true,
  enableScss: true,
  enableSyntaxHighlighting: true,
  feeds: {
    atom: false,
    json: false,
    rss: false,
  },
  markdownItOptions: {
    html: true,
    linkify: true,
    typographer: true,
  },
  passthrough: {
    dirs: [],
    files: [],
  },
  templateFormats: ["html", "md", "njk"],
}
```

TODO FIXME document what the options do

### important note

Currently, because of the way config overrides are applied, if you
override a top-level default, (e.g., `passthrough`), you must provide
all the keys present in the default. For example, if you wanted to add
an `images` directory to `passthru:dirs`, your config override would
need to look like:

```javascript
const myConfigConfig = {
  passthrough: {
    dirs: ["images"],
    files: [],
  },
};
```

Emitting the `passthrough:files` key will result in an error.

[11ty]: https://www.11ty.dev/
[11ty's TypeScript docs]: https://www.11ty.dev/docs/languages/typescript/#using-a-type-script-configuration-file