open-index/open-npm huggingface dataset:
npm package: @synonymdev/slashtags-rpc
Description: helper module for creating RPCs using Slashtags nodes
Latest version: 1.0.0-alpha.6

# rpc

helper module for creating RPCs using Slashtags nodes

## Installation

```
npm install @synonymdev/slashtags-rpc
```

## Usage

```js
import SlashtagsRPC from '@synonymdev/slashtags-rpc';
import Slashtag from '@synonymdev/slashtag';
import c from 'compact-encoding';

class Foo extends SlashtagsRPC {
  get id() {
    return 'foo';
  }

  get valueEncoding() {
    return c.string;
  }

  get handshakeEncoding() {
    return c.string;
  }

  handshake(socket) {
    return this.id + '-handshake:for:' + socket.remotePublicKey.toString('hex');
  }

  onopen(handshake, socket) {
    this.emit('handshake', handshake, socket.reomtePublicKey);
  }

  get methods() {
    const self = this;
    return [
      {
        name: 'echo',
        handler: self._onEcho.bind(self)
      }
    ]
  }

  _onEcho (req) {
    this.emit('echo', req)
    return req
  }

  async echo (key, message) {
    const rpc = await this.rpc(key)
    return rpc?.request('echo', message)
  }
}

const alice = new Slashtag();
await alice.listen();

const aliceFoo = new Foo(alice);
aliceFoo.on('echo', (req) => { console.log(req) })

const bob = new Slashtag();
const bobFoo = new Foo(bob);

const response = await bobFoo.echo(alice.key, 'hello world');
```

## API

#### const rpc = new SlashtagsRPC({swarm})

Create a new instance of SlashtagsRPC using a [Hyperswarm](https://github.com/holepunchto/hyperswarm) instance.

#### `id`

String identifies your RPC protocol.

#### `valueEncoding`

Default [compact encoding](https://github.com/compact-encoding/compact-encoding) for all requests and responses.

#### `handshakeEncoding`

Default [compact encoding](https://github.com/compact-encoding/compact-encoding) for handshake message, sent first thing on opening the channel.

#### `handshake(stream) => any`

A callback function that should returns the handshake value. `stream` is a [SecretStream](https://github.com/hyperswarm/secret-stream).

#### `onopen(handshake, stream)`

A callback on opening the rpc. `handshake` is the value sent on opening the channel, `stream` is a [SecretStream](https://github.com/hyperswarm/secret-stream).

#### `methods`

An array of methods objects that should be as following:

```js
{
    name: string,
    options?: {
        // Optional encoding for both the request and response
        valueEncoding: Encoding,
        // Optional encoding for requests
        requestEncoding: Encoding,
        // Optional encoding for responses
        responseEncoding: Encoding
    },
    // Handler that takes the decoded request and returns a response value
    handler: (req) => any
}
```

#### `rpc(key)`

Returns a [ProtomuxRPC](https://www.npmjs.com/package/protomux-rpc) instance after connecting to a Slashtag by its key, id or url. If connection is already opened, the same RPC instance is returned.

this is an idempotent operation, meaning if there is already an existing opened connection, it won't create new ones.
npm package: @synor/core
Description: Synor - Database Schema Migration Library - Core
Author: Munif Tanjim
Latest version: 0.10.1

[![Synor Core](https://img.shields.io/badge/synor-core-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/core?style=for-the-badge)](https://npmjs.org/package/@synor/core)
[![Coverage](https://img.shields.io/codecov/c/gh/Synor/synor/master?flag=core&style=for-the-badge)](https://codecov.io/gh/Synor/synor/tree/master/packages/core)
[![License](https://img.shields.io/npm/l/@synor/core?style=for-the-badge)](https://github.com/Synor/synor/blob/master/packages/core/blob/master/LICENSE)

# Synor Core

Synor - Database Schema Migration Library - Core

## Installation

```sh
# using yarn:
yarn add @synor/core

# using npm:
npm install --save @synor/core
```

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synor/database-mongodb
Description: Synor Database Engine - MongoDB
Author: Tahmid Sadik
Latest version: 0.3.2

[![Synor Database](https://img.shields.io/badge/synor-database-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/database-mongodb?style=for-the-badge)](https://npmjs.org/package/@synor/database-mongodb)
[![Coverage](https://img.shields.io/codecov/c/gh/Synor/synor/master?flag=database_mongodb&style=for-the-badge)](https://codecov.io/gh/Synor/synor/tree/master/packages/database-mongodb)
[![License](https://img.shields.io/npm/l/@synor/database-mongodb?style=for-the-badge)](https://github.com/Synor/synor/blob/master/packages/database-mongodb/blob/master/LICENSE)

# Synor Database MongoDB

Synor Database Engine - MongoDB

## Installation

```sh
# using yarn:
yarn add @synor/database-mongodb mongodb

# using npm:
npm install --save @synor/database-mongodb mongodb
```

## URI

**Format**: `mongodb[+srv]://[username:password@]hostname[:port]/database[?param=value&...]`

**Params**:

| Name                                | Description                          | Default Value            |
| ----------------------------------- | ------------------------------------ | ------------------------ |
| `synor_migration_record_collection` | Name for Migration Record Collection | `synor_migration_record` |

**Examples**:

- `mongodb://mongo:mongo@127.0.0.1:27017/synor?synor_migration_record_collection=migration_record`

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synor/database-mysql
Description: Synor Database Engine - MySQL
Author: Munif Tanjim
Latest version: 0.7.0

[![Synor Database](https://img.shields.io/badge/synor-database-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/database-mysql?style=for-the-badge)](https://npmjs.org/package/@synor/database-mysql)
[![Coverage](https://img.shields.io/codecov/c/gh/Synor/synor/master?flag=database_mysql&style=for-the-badge)](https://codecov.io/gh/Synor/synor/tree/master/packages/database-mysql)
[![License](https://img.shields.io/npm/l/@synor/database-mysql?style=for-the-badge)](https://github.com/Synor/synor/blob/master/packages/database-mysql/blob/master/LICENSE)

# Synor Database MySQL

Synor Database Engine - MySQL

## Installation

```sh
# using yarn:
yarn add @synor/database-mysql mysql2

# using npm:
npm install --save @synor/database-mysql mysql2
```

## URI

**Format**: `mysql://[user[:password]@][hostname][:port]/database[?param=value&...]`

**Params**:

| Name                           | Description                                                                   | Default Value            |
| ------------------------------ | ----------------------------------------------------------------------------- | ------------------------ |
| `ssl`                          | [MySQL SSL Options](https://www.npmjs.com/package/mysql/v/2.17.1#ssl-options) | `undefined`              |
| `synor_migration_record_table` | Name for Migration Record Table                                               | `synor_migration_record` |

**Examples**:

- `mysql://root:root@127.0.0.1:3306/synor?synor_migration_record_table=migration_record`

```js
// SSL Example

const ssl = JSON.stringify({
  ca: '<path-to-file>',
  cert: '<path-to-file>',
  ciphers: '<string>',
  key: '<path-to-file>',
  passphrase: '<string>',
  rejectUnauthorized: '<boolean>',
}) // 'Amazon RDS'

const uri = `mysql://root:root@127.0.0.1:3306/synor?ssl=${encodeURIComponent(
  ssl
)}`
```

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synor/database-postgresql
Description: Synor Database Engine - PostgreSQL
Author: Munif Tanjim
Latest version: 0.5.2

[![Synor Database](https://img.shields.io/badge/synor-database-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/database-postgresql?style=for-the-badge)](https://npmjs.org/package/@synor/database-postgresql)
[![Coverage](https://img.shields.io/codecov/c/gh/Synor/synor/master?flag=database_postgresql&style=for-the-badge)](https://codecov.io/gh/Synor/synor/tree/master/packages/database-postgresql)
[![License](https://img.shields.io/npm/l/@synor/database-postgresql?style=for-the-badge)](https://github.com/Synor/synor/blob/master/packages/database-postgresql/blob/master/LICENSE)

# Synor Database PostgreSQL

Synor Database Engine - PostgreSQL

## Installation

```sh
# using yarn:
yarn add @synor/database-postgresql pg

# using npm:
npm install --save @synor/database-postgresql pg
```

## URI

**Format**: `postgresql://[user[:password]@][hostname][:port]/database[?param=value&...]`

**Params**:

| Name                           | Description                                                                   | Default Value            |
| ------------------------------ | ----------------------------------------------------------------------------- | ------------------------ |
| `schema`                       | [PostgreSQL Schema](https://www.postgresql.org/docs/current/ddl-schemas.html) | `public`                 |
| `ssl`                          | [SSL configuration](https://node-postgres.com/features/sslu)                  | `false`                  |
| `synor_migration_record_table` | Name for Migration Record Table                                               | `synor_migration_record` |

**Examples**:

- `postgresql://postgres:postgres@127.0.0.1:5432/synor?synor_migration_record_table=migration_record`
- `postgresql://postgres:postgres@127.0.0.1:5432/synor?schema=synor`

```js
// SSL Example

const ssl = {
  ca: '<path-to-file>',
  cert: '<path-to-file>',
  key: '<path-to-file>',
  passphrase: '<string>',
  rejectUnauthorized: '<boolean>',
  secureOptions: '<number>',
}

const uri = `postgresql://postgres:postgres@127.0.0.1:5432/synor?ssl=${encodeURIComponent(
  JSON.stringify(ssl)
)}`
```

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synor/database-sqlite
Description: Synor Database Engine - SQLite
Author: Munif Tanjim
Latest version: 0.3.2

[![Synor Database](https://img.shields.io/badge/synor-database-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/database-sqlite?style=for-the-badge)](https://npmjs.org/package/@synor/database-sqlite)
[![Coverage](https://img.shields.io/codecov/c/gh/Synor/synor/master?flag=database_sqlite&style=for-the-badge)](https://codecov.io/gh/Synor/synor/tree/master/packages/database-sqlite)
[![License](https://img.shields.io/npm/l/@synor/database-sqlite?style=for-the-badge)](https://github.com/Synor/synor/blob/master/packages/database-sqlite/blob/master/LICENSE)

# Synor Database SQLite

Synor Database Engine - SQLite

## Installation

```sh
# using yarn:
yarn add @synor/database-sqlite better-sqlite3

# using npm:
npm install --save @synor/database-sqlite better-sqlite3
```

## URI

**Format**: `sqlite://[.]/path[?param=value&...]`

**Params**:

| Name                           | Description                                                          | Default Value            |
| ------------------------------ | -------------------------------------------------------------------- | ------------------------ |
| `schema`                       | SQLite Schema name                                                   | `main`                   |
| `synor_migration_record_table` | Name for Migration Record Table                                      | `synor_migration_record` |
| `file_must_exist`              | Error will be thrown if the database file does not exist             | `false`                  |
| `memory`                       | Open an in-memory database, rather than a disk-bound one             | `false`                  |
| `readonly`                     | Open the database connection in readonly mode                        | `false`                  |
| `timeout`                      | Number of milliseconds to wait before throwing a `SQLITE_BUSY` error | `5000`                   |

**Examples**:

- `sqlite:///path/to/sqlite.db` (Absolute path)
- `sqlite://./path/to/sqlite.db` (Relative path)
- `sqlite://?memory=true` (Open an in-memory database)

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synor/eslint-config
Description: ESLint configuration for Synor
Author: Munif Tanjim
Latest version: 0.1.0

[![Synor Config](https://img.shields.io/badge/synor-config-blue?style=for-the-badge)](https://github.com/Synor)
[![Version](https://img.shields.io/npm/v/@synor/eslint-config?style=for-the-badge)](https://npmjs.org/package/@synor/eslint-config)
[![License](https://img.shields.io/github/license/Synor/source-file?style=for-the-badge)](https://github.com/Synor/eslint-config/blob/master/LICENSE)

# ESLint Configuration for Synor

ESLint shareable configuration for [Synor](https://github.com/Synor).

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.
npm package: @synoxia/react-gauge-component-main
Description: Gauge component for React
Author: Synoxia
Latest version: 1.1.3-0.4

# react-gauge-component 
React Gauge Chart Component for data visualization.

<img width="1840" height="608" alt="image" src="https://github.com/user-attachments/assets/fe12d0f7-805c-4914-9c80-c6a41432726b" />

A gallery of preset gauges and a sandbox editor is provided so you can create and edit your gauges in the [DEMO](https://antoniolago.github.io/react-gauge-component) page

## Quick Start 

Install with your package manager

```js
npm install react-gauge-component-main --save
```
```js
pnpm add react-gauge-component-main --save
```
```
yarn add react-gauge-component-main.
```
```
bun add react-gauge-component-main.
```

Then import it:

```jsx
import GaugeComponent from 'react-gauge-component-main';
//or
import { GaugeComponent } from 'react-gauge-component-main';

//Component with default values
<GaugeComponent />
```

For next.js you'll have to do dynamic import:
```jsx
import dynamic from "next/dynamic";
const GaugeComponent = dynamic(() => import('react-gauge-component-main'), { ssr: false });

//Component with default values
<GaugeComponent />
```

# API
 
API reference is auto-generated from the TypeScript types:
 
- **[`API.md`](https://gitlab.com/synoxia.fr/react-gauge-component-main/-/blob/main/API.md)**
 

## 
Forked from [@Martin36/react-gauge-chart](https://github.com/Martin36/react-gauge-chart) [0b24a45](https://github.com/Martin36/react-gauge-chart/pull/131).

##
Forked from [@antoniolago/react-gauge-component](https://github.com/antoniolago/react-gauge-component) [0b24a45](https://github.com/antoniolago/react-gauge-component/pull/131).
npm package: @synpatico/client
Description: Synpatico client library
Author: Michael Sweeney
Latest version: 1.0.2

# @synpatico/client

A client library for optimizing network requests using the Synpatico protocol.

## Installation

```bash
npm install @synpatico/client
```

## Usage

The library provides two ways to use Synpatico:

### 1. Automatic Global Patching

Automatically patches `fetch` and `XMLHttpRequest` to optimize all network requests:

```javascript
import { patchGlobals } from '@synpatico/client/patch'

// Patch all requests
const handle = patchGlobals()

// Or patch only specific URLs
const handle = patchGlobals({
  isTargetUrl: (url) => url.includes('api.example.com')
})

// Later, if needed, unpatch
handle.unpatch()
```

### 2. Manual Client Usage

Use the client manually for specific requests:

```javascript
import { createSynpaticoClient } from '@synpatico/client/client'

const client = createSynpaticoClient({
  isTargetUrl: (url) => url.includes('api.example.com')
})

// Use the optimized fetch
const response = await client.fetch('https://api.example.com/data')
const data = await response.json()

// Clear cache if needed
client.clearCache()

// Access the registry
const registry = client.getRegistry()
```

## Options

Both `patchGlobals` and `createSynpaticoClient` accept the following options:

- `isTargetUrl?: (url: string) => boolean` - Filter which URLs to optimize
- `enableLifecycle?: boolean` - Enable lifecycle hooks (default: true)
- `lifecycle?: object` - Lifecycle event handlers
  - `onPacketDecoded?: (info) => void` - Called when a packet is decoded
  - `onLearnedStructure?: (info) => void` - Called when a new structure is learned
  - `onError?: (error, context) => void` - Called on errors
  - `transformDecoded?: (info) => any` - Transform decoded data

## Import Paths

- `@synpatico/client` - All exports (default)
- `@synpatico/client/patch` - Only patching functionality
- `@synpatico/client/client` - Only client functionality

## License

MIT