open-index/open-npm huggingface dataset:
npm package: @refraction-ui/shared
Description: Shared utilities for Refraction UI components
Latest version: 0.1.1

# @refraction-ui/shared

Shared utilities used across all Refraction UI packages. Part of [Refraction UI](https://elloloop.github.io/refraction-ui/).

## Install

```bash
pnpm add @refraction-ui/shared
```

## Usage

```tsx
import { cn } from '@refraction-ui/shared'

const className = cn('base-class', condition && 'conditional-class')
```

## License

MIT
npm package: @refraction-ui/tailwind-config
Description: Tailwind CSS configuration and design tokens for Refraction UI
Latest version: 0.1.1

# @refraction-ui/tailwind-config

Tailwind CSS preset for Refraction UI. Part of [Refraction UI](https://elloloop.github.io/refraction-ui/).

## Install

```bash
pnpm add -D @refraction-ui/tailwind-config
```

## Usage

```ts
// tailwind.config.ts
import type { Config } from 'tailwindcss'
import { refractionPreset } from '@refraction-ui/tailwind-config'

export default {
  content: ['./src/**/*.{js,ts,jsx,tsx}'],
  presets: [refractionPreset],
} satisfies Config
```

## License

MIT
npm package: @refractionx/rfx-art-net-js
Description: JavaScript client for RFX Art-Net over WebSockets
Author: Samuil Aleksov
Latest version: 1.0.6

#### Checkout [Example app](https://github.com/refractionx/rfx-art-net/tree/main/example)

### Install

```
npm i --save @refractionx/rfx-art-net-js
```

### Import
```javascript
import rfxArtNetLoader from '@refractionx/rfx-art-net-js';
```

### Load
```javascript
// a compiled WASM module is shipped in build directory of this package
const rfxArtNet = await rfxArtNetLoader(fetch('rfxArtNet.wasm'));
...
```

### Use
```javascript
let channelsIn;
let channelsOut = new Uint8Array(Array(512).fill(0));
...

// read channels from an Art-Net packet in a WebSocket frame 
channelsIn = rfxArtNet.getChannels(wsMessage.data);

...

// write channels to an Art-Net packet, universe 1, send in a WebSocket frame
ws.send(rfxArtNet.getPacket(channelsOut, 1));
```
npm package: @refractionx/rfx-art-net-node
Description: Node.js proxy for RFX Art-Net over WebSockets
Author: Samuil Aleksov
Latest version: 1.0.6

#### Checkout [Example app](https://github.com/refractionx/rfx-art-net/tree/main/example)

### Install

```
npm i --save @refractionx/rfx-art-net-node
```

### Import
```javascript
import { RFXArtNetPacket, RFXArtNetWSProxyServer, getWebSocketFrame } from '@refractionx/rfx-art-net-node';
```

### Setup optional WS/Art-Net (UDP) Proxy
```javascript
...
import udp from 'dgram';
// example client used to proxy Art-Net packets
const client = udp.createSocket('udp4');
...
RFXArtNetWSProxyServer(serverOrPort, function onClient(socket) {
    // write example
    // create an RFXArtNetPacket with 3 channels and send over the WebSocket
    const packetWS = new RFXArtNetPacket(3);
    socket.write(getWebSocketFrame(packetWS));
}, function onPacket(packet) {
    // read and proxy Art-Net packet over UDP example
    client.send(packet, 6454, 'localhost');
});
...
```

### Use
```javascript
const packet = new RFXArtNetPacket(512);

// inspect packet
console.log(packet.hex());

// inspect data channels
console.log(packet.channels);

packet.setUniverse(1);
packet.setSequence(0);

// inspect Art-Net buffer
console.log(packet.buffer);
...

// get a WebSocket frame to send directly
socket.write(getWebSocketFrame(packet));

// or send over UDP as a normal Art-Net packet
client.send(packet, 6454, '...host..or..ip');
```