open-index/open-npm huggingface dataset:
npm package: @room236/safe
Description: Undefined-safety for TypeScript/JavaScript
Author: Richard Kriesman
Latest version: 1.0.1

# Safe

Undefined-safety for TypeScript/JavaScript

## Example

```typescript
import {safe} from '@room236/safe';

class Foo {
    public bar: string|undefined;

    public calculateImportantValue(): number|undefined {
        return null;
    }

    public getRandomNumber(): number {
        return 4; // chosen by fair dice roll.
                  // guaranteed to be random.
    }

    public throwError(): void {
        throw new Error('This method throws an error.');
    }

}


const foo = new Foo();
safe(() => foo.bar);                            // returns undefined
safe(() => foo.nonExistentValue);               // returns undefined
safe(() => foo.nonExistentValue.doSomething()); // returns undefined
safe(() => foo.nonExistentValue, -1);           // returns -1
safe(() => foo.calculateImportantValue());      // returns null
safe(() => foo.getRandomNumber());              // returns 4
safe(() => foo.throwError());                   // throws Error
```

## Changelog

### 1.0.1
* Added this README

### 1.0.0
* Added the `safe()` function
npm package: @roomjs/eslint-config-ts
Description: ESLint configuration for TypeScript projects
Author: Yuri Drabik
Latest version: 2.0.2

# @roomjs/eslint-config-ts

[![npm version](https://badge.fury.io/js/%40roomjs%2Feslint-config-ts.svg)](https://badge.fury.io/js/%40roomjs%2Feslint-config-ts)

Another ESLint config for TypeScript projects.

## Installation

* `npx install-peerdeps -D @roomjs/eslint-config-ts`

## Usage

Create `.eslintrc` file in the root folder of your project with the following content:

```json
{
  "extends": "@roomjs/eslint-config-ts"
}
```
npm package: @roomjs/vue-shop-item
Description: Vue.js item preview component for E-Commerce websites and online stores.
Author: Yuri Drabik
Latest version: 0.0.18

# @roomjs/vue-shop-item
[![Build Status](https://travis-ci.org/room-js/vue-shop-item.svg?branch=master)](https://travis-ci.org/room-js/vue-shop-item)

`Vue.js` (v.2) component for online stores
npm package: @roomkit/core
Description: Core types, protocols and Redis utilities for RoomKit multiplayer framework
Latest version: 1.3.1

# @roomkit/core

Core types, protocols, and utilities for the RoomKit framework.

## Installation

```bash
npm install @roomkit/core
```

## Features

- 🔌 **Protocol Definitions** - Message IDs, types, and payloads
- 🔑 **Redis Keys** - Standardized Redis key patterns
- 📝 **TypeScript Types** - Complete type definitions for all protocols
- 🛠️ **Utilities** - Common utilities for Gateway and Worker

## Exports

### Protocol

```typescript
import { MessageId, MessageType } from '@roomkit/core';

// Message IDs
MessageId.AUTH
MessageId.CREATE_ROOM
MessageId.JOIN_ROOM
// ... etc

// Message Types
MessageType.REQUEST
MessageType.RESPONSE
MessageType.NOTIFICATION
```

### Redis Keys

```typescript
import { RedisKeys, RedisChannels } from '@roomkit/core/redis';

// Keys
RedisKeys.session(sessionId)
RedisKeys.room(roomId)
RedisKeys.gateway(gatewayId)
RedisKeys.worker(workerId)

// Channels
RedisChannels.rpcGateway(gatewayId)
RedisChannels.rpcWorker(workerId)
RedisChannels.broadcast()
```

### Types

```typescript
import type { 
  WsMessage,
  AuthPayload,
  CreateRoomPayload,
  JoinRoomPayload 
} from '@roomkit/core';
```

## Usage

This package is primarily used internally by `@roomkit/gateway` and `@roomkit/worker`, but can also be used by:

- Custom room implementations
- Testing utilities
- Protocol-compatible clients

## License

MIT
npm package: @roomkit/create
Description: Create a new RoomKit multiplayer project
Author: RoomKit Team
Latest version: 1.3.2

# create-roomkit

Scaffolding tool for creating new RoomKit multiplayer projects.

## Usage

Create a new RoomKit project with:

```bash
npm create roomkit@latest
```

Or with npm 7+:

```bash
npm create roomkit@latest my-game
```

Or with pnpm:

```bash
pnpm create roomkit my-game
```

Or with yarn:

```bash
yarn create roomkit my-game
```

## Templates

Choose from three templates:

### Basic
A minimal gateway + worker setup with a simple room.
Perfect for learning or starting a custom project.

### Chat Room
A fully-featured real-time chat application with:
- User presence
- Typing indicators
- Chat history
- Username customization

### Game Room
A turn-based Tic-Tac-Toe game demonstrating:
- Turn-based gameplay
- Win/draw detection
- Game state management
- Player disconnect handling

## Options

```bash
# Specify project name
npm create roomkit@latest my-project

# Specify template
npm create roomkit@latest my-project -- --template chat-room

# Available templates: basic, chat-room, game-room
```

## After Creation

```bash
cd my-project
npm install
npm run dev
```

Make sure you have Redis running locally, or configure it in the `.env` file.

## Requirements

- Node.js 18+
- Redis server

## Project Structure

All templates include:

```
my-project/
├── src/
│   ├── gateway.ts       # Gateway server
│   ├── worker.ts        # Worker server
│   └── rooms/           # Your game rooms
├── package.json
├── tsconfig.json
├── .env.example
└── README.md
```

## Learn More

- [RoomKit Documentation](https://github.com/daxing/gateway-worker)
- [Gateway API](https://www.npmjs.com/package/@roomkit/gateway)
- [Worker API](https://www.npmjs.com/package/@roomkit/worker)
- [Client SDK](https://www.npmjs.com/package/@roomkit/client)

## License

MIT
npm package: @roomrtc/mediaserver
Description: A simple media server for RoomRTC
Author: vunb
Latest version: 0.11.1

# RoomRTC Media Server

A simple media server for RoomRTC

# Run roomrtc media as your own server

The program requires the following dependencies (easy to install using `npm`)

* [roomrtc](https://github.com/vunb/roomrtc) - Framework enables quick development of WebRTC
* [mediasoup](https://github.com/ibc/mediasoup) - Cutting Edge WebRTC Video Conferencing

Follow these steps to run the server:

* Clone repo: `git clone https://github.com/roomrtc/mediaserver.git roomrtc-media-server`
* Change dir: `cd roomrtc-media-server`
* Install deps: `npm install`
* Start server: `npm start`
* Open browser: `http://localhost:8123/?myroom`

Install via npm:

```bash
npm install @roomrtc/mediaserver
```

Prior to that, ensure your host satisfies the following **requirements**:

* Node.js >= `v6.9.1`
* POSIX based operating system (Windows not yet supported)
* Python 2 (`python2` or `python` command must point to the Python 2 executable)
* `make`
* `gcc` and `g++`, or `clang`, with C++11 support

*NOTE*: In Debian and Ubuntu install the `build-essential` package. It includes both make and gcc/g++.

# License

MIT
npm package: @rooms-haxball/connector
Description: Conecta una sala de HaxBall al dashboard multi-tenant de Rooms HaxBall sin tener que gestionar Socket.IO manualmente.
Latest version: 0.1.1

# @rooms-haxball/connector

Conecta una sala de HaxBall al dashboard multi-tenant de Rooms HaxBall sin tener que gestionar Socket.IO manualmente.

## Installation

```bash
npm install @rooms-haxball/connector socket.io-client
```

`socket.io-client` se declara como **peer dependency** para evitar versiones duplicadas en tu bot.

## Environment Variables

Variables opcionales de fallback para migraciones y despliegues existentes:

- `DASHBOARD_HUB_URL`: URL base del dashboard (ej. `https://dashboard.example.com`).
- `DASHBOARD_API_KEY`: API key de tu sala (`rhb_...`) generada desde `/keys`.
- `INTERNAL_API_KEY`: fallback temporal legacy si aún no definiste `DASHBOARD_API_KEY`.

## 5-line Usage Example

```js
const { connectToDashboard } = require('@rooms-haxball/connector');
const room = createRoom();
const apiKey = 'rhb_1234567890abcdef1234567890abcdef';
const dashboardUrl = 'https://dashboard.example.com';
connectToDashboard(room, { apiKey, roomId: 'my-room', roomName: 'My Room', dashboardUrl });
```

## Configuration

`connectToDashboard(room, { apiKey, roomId, roomName, dashboardUrl })`:

- `apiKey`: API key de la sala. **Primario por opciones**.
- `dashboardUrl`: URL base del dashboard. **Primario por opciones**.
- Fallback opcional para migración: si omites `apiKey` o `dashboardUrl`, el conector usa `DASHBOARD_API_KEY`/`INTERNAL_API_KEY` y `DASHBOARD_HUB_URL`.

- `roomId`: identificador estable de la sala (ej. `rambo`, `rs-4v4`).
- `roomName`: nombre visible en el dashboard.
- El conector envía `connectorVersion` en el handshake para telemetría y compatibilidad operativa.

## Troubleshooting

- **No conecta al dashboard**: verifica `DASHBOARD_HUB_URL` y `DASHBOARD_API_KEY`.
- **Error 401/403**: la API key puede estar revocada o asociada a otra sala.
- **Dashboard reiniciado**: la reconexión es automática (`reconnection: true`).
- **Advertencia por `INTERNAL_API_KEY`**: migra a `DASHBOARD_API_KEY`; el fallback es temporal.

## Liga Integration (Socket.IO)

Si quieres enviar eventos de partido a un backend de liga separado (goles, asistencias, telemetría), usa `connectToLiga`.

```js
const { connectToLiga } = require('@rooms-haxball/connector');

connectToLiga(room, {
  backendUrl: 'http://localhost:4300',
  apiKey: process.env.BOT_LIGA_SOCKET_API_KEY,
  roomId: 'liga-principal',
  telemetryIntervalMs: 1000,
  homeTeamId: 1,
  awayTeamId: 2,
  seasonName: 'Temporada 1',
});
```

Variables de entorno de fallback para liga:

- `BOT_LIGA_SOCKET_API_KEY`: clave de autenticacion Socket.IO del backend liga.
- `BOT_LIGA_BACKEND_URL`: URL del backend liga (si no se pasa `backendUrl`).
- `BOT_LIGA_API_BASE`: fallback adicional para URL base de liga.
npm package: @roomservice/browser
Description: [Room Service](https://www.roomservice.dev/) helps you add real-time collaboration to your app. It's a real-time service with a built-in [CRDT](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) that automatically merges multiple people's s
Author: Evan Conrad
Latest version: 3.0.4

<p align="center">
  <img src="./misc/logo.svg" width=450 />
</p>

# @roomservice/browser

[Room Service](https://www.roomservice.dev/) helps you add real-time collaboration to your app. It's a real-time service with a built-in [CRDT](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) that automatically merges multiple people's state together without horrifying nightmare bugs. To learn more, see [roomservice.dev](https://www.roomservice.dev).

This is the official, ~javascript~ typescript SDK.

## Install

```bash
npm install --save @roomservice/browser
```
npm package: @roomservice/ion-sdk-js
Description: A js sdk for ion sfu
Author: pion
Latest version: 1.6.4

# ion-sdk-js

Frontend sdk for the Ion backend.

## Installation

`npm install ion-sdk-js`

## Usage

```ts
import { Client, LocalStream, RemoteStream } from 'ion-sdk-js';
import { IonSFUJSONRPCSignal } from 'ion-sdk-js/lib/signal/json-rpc-impl';
const signal = new IonSFUJSONRPCSignal("wss://ion-sfu:7000");
const client = new Client(signal);
signal.onopen = () => client.join("test session", "test uid")

// Setup handlers
client.ontrack = (track: MediaStreamTrack, stream: RemoteStream) => {
    // mute a remote stream
    stream.mute()
    // unmute a remote stream
    stream.unmute()

    if (track.kind === "video") {
         // prefer a layer
         stream.preferLayer("low" | "medium" | "high")
    }
});

// Get a local stream
const local = await LocalStream.getUserMedia({
    audio: true,
    video: true,
    simulcast: true, // enable simulcast
});

// Publish stream
client.publish(local);

// mute local straem
local.mute()

// unmute local stream
local.unmute()

// create a datachannel
const dc = client.createDataChannel("data")
dc.onopen = () => dc.send("hello world")

// Close client connection
client.close();
```
npm package: @roomservice/react
Description: ``` yarn add @roomservice/react ```
Author: Flaque
Latest version: 1.0.6

<h1 align="center">
  <br>
  <img src="./misc/logo.png" alt="@roomservice/react"  />
  <br>
  <br>
  <br>
</h1>

This is the official React client for [Room Service](https://www.roomservice.dev/). Check out the [Documentation](https://www.roomservice.dev/docs/react-getting-started) for help getting started. Also join our official [Room Service Discord](https://discord.com/invite/VdPpp7Mx9u)!

## Install 

```
yarn add @roomservice/react
```

## Usage

See [the documentation](https://docs.roomservice.dev/docs/guides/react).