open-index/open-npm huggingface dataset:
npm package: @i-xi-dev/mimetype
Description: A JavaScript MIME type parser and serializer, implements the MIME type defined in WHATWG MIME Sniffing Standard.
Author: i-xi-dev
Latest version: 1.2.24

# @i-xi-dev/mimetype

A JavaScript MIME type parser and serializer, implements [the MIME type defined in WHATWG MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/#understanding-mime-types).


## Requirement

| Chrome | Edge | Firefox | Safari | Deno | Node.js |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |


## Installation

### npm

```console
$ npm i @i-xi-dev/mimetype@1.2.24
```

```javascript
import { MediaType } from "@i-xi-dev/mimetype";
```

### CDN

Example for Skypack
```javascript
import { MediaType } from "https://cdn.skypack.dev/@i-xi-dev/mimetype@1.2.24";
```


## Usage

### [`MediaType`](https://doc.deno.land/https://raw.githubusercontent.com/i-xi-dev/mimetype.es/1.2.24/mod.ts/~/MediaType) class

Parse a MIME type string
```javascript
const mediaType = MediaType.fromString('application/soap+xml; charset=utf-8;action="https://example.com/example"');

mediaType.type;
// → "application"

mediaType.subtype;
// → "soap+xml"

mediaType.essence;
// → "application/soap+xml"

[ ...mediaType.parameterNames() ];
// → [ "charset", "action" ]

[ ...mediaType.parameters() ];
// → [ ["charset", "utf-8"], ["action", "https://example.com/example"] ]

mediaType.hasParameter("charset");
// → true

mediaType.getParameterValue("action");
// → "https://example.com/example"
```

Serialize a MIME type
```javascript
const mediaType = MediaType.fromString('application/soap+xml; charset=utf-8;action="https://example.com/example"');
mediaType.toString();
// → 'application/soap+xml;charset=utf-8;action="https://example.com/example"'
```

Equivalent comparisons
```javascript
const mediaType = MediaType.fromString('application/soap+xml; charset=utf-8;action="https://example.com/example"');

const mediaType2 = MediaType.fromString('application/soap+xml; charset=utf-16;action="https://example.com/example"');
mediaType.equals(mediaType2);
// → false

const mediaType3 = MediaType.fromString('APPLICATION/SOAP+XML;ACTION="https://example.com/example";CHARSET=utf-8');
mediaType.equals(mediaType3);
// → true

const mediaType4 = MediaType.fromString('application/soap+xml; charset=UTF-8;action="https://example.com/example"');
mediaType.equals(mediaType4);
// → false
mediaType.equals(mediaType4, { caseInsensitiveParameters: ["charset"] });
// → true
```

Instance is immutable
```javascript
const mediaType = MediaType.fromString('application/soap+xml; charset=utf-8;action="https://example.com/example"');

const mediaType2 = mediaType.withParameters([ ["charset": "UTF-16"] ]);
mediaType2.toString();
// → 'application/soap+xml;charset=UTF-16'
const mediaType3 = mediaType.withoutParameters();
mediaType3.toString();
// → 'application/soap+xml'
mediaType.toString();
// → 'application/soap+xml;charset=utf-8;action="https://example.com/example"'
```
npm package: @i-xi-dev/ms932-encoder
Description: A JavaScript Windows-31J encoder, implements Shift_JIS encoder defined in WHATWG Encoding Standard.
Author: i-xi-dev
Latest version: 2.1.9

# @i-xi-dev/ms932-encoder

A JavaScript Windows-31J encoder, implements
[Shift_JIS encoder](https://encoding.spec.whatwg.org/#shift_jis-encoder) defined
in WHATWG Encoding Standard.


## Requirement

### `Ms932.Encoder` class

| Chrome | Edge | Firefox | Safari | Deno | Node.js |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |

### `Ms932.EncoderStream` class

`Ms932.EncoderStream` requires
[`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream).

| Chrome | Edge | Firefox | Safari | Deno | Node.js |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ✅ | ✅ | ✅<br />102+ | ✅<br />14.1+ | ✅ | ✅<br />16.5+ |


## Installation

### npm

```console
$ npm i @i-xi-dev/ms932-encoder@2.1.9
```

```javascript
import { Ms932 } from "@i-xi-dev/ms932-encoder";
```

### CDN

Example for UNPKG

```javascript
import { Ms932 } from "https://www.unpkg.com/@i-xi-dev/ms932-encoder@2.1.9/esm/mod.js";
```

## Usage

### [`Ms932.Encoder`](https://doc.deno.land/https://raw.githubusercontent.com/i-xi-dev/ms932-encoder.es/2.1.9/mod.ts/~/Ms932.Encoder) class

The `Ms932.Encoder` implements the
[`TextEncoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)
interface.

```javascript
const encoder = new Ms932.Encoder();

encoder.encode("あいうえお");
// → Uint8Array[ 0x82, 0xA0, 0x82, 0xA2, 0x82, 0xA4, 0x82, 0xA6, 0x82, 0xA8 ]

const bytes = new Uint8Array(10);
const { read, written } = encoder.encodeInto("あいうえお", bytes);
// → read: 5
//   written: 10
//   bytes: Uint8Array[ 0x82, 0xA0, 0x82, 0xA2, 0x82, 0xA4, 0x82, 0xA6, 0x82, 0xA8 ]
```

#### Encoding error handling

```javascript
const encoder = new Ms932.Encoder({ fatal: false }); // default

encoder.encode("𩸽");
// → Uint8Array[ 0x3F ]
```

```javascript
const encoder = new Ms932.Encoder({ replacementChar: "■" });

encoder.encode("𩸽");
// → Uint8Array[ 0x81, 0xA1 ]
```

```javascript
const encoder = new Ms932.Encoder({ fatal: true });

encoder.encode("𩸽");
// → throws TypeError.
```

### [`Ms932.EncoderStream`](https://doc.deno.land/https://raw.githubusercontent.com/i-xi-dev/ms932-encoder.es/2.1.9/mod.ts/~/Ms932.EncoderStream) class

The `Ms932.EncoderStream` implements
[`TextEncoderStream`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoderStream)
interface.

```javascript
const encoderStream = new Ms932.EncoderStream();

// readableStream: ReadableStream<string>
// writableStream: WritableStream<Uint8Array>
readableStream.pipeThrough(encoderStream).pipeTo(writableStream);
```

## Examples

- [Windows-31J encode](https://i-xi-dev.github.io/ms932-encoder.es/example/ms932_encode.html)

## FAQ

**Q:** Where is Ms932.Decoder?

**A:** Browsers and Node.js implement the
[Shift_JIS decoder](https://encoding.spec.whatwg.org/#shift_jis-decoder). Use a
[`TextDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder).

```javascript
const decoder = new TextDecoder("shift_jis");
```
npm package: @i-xi-dev/pubsub
Description: A JavaScript Pub/Sub Broker.
Author: i-xi-dev
Latest version: 2.0.17

# @i-xi-dev/pubsub

A JavaScript Pub/Sub Broker.


## Requirement

`Broker` requires [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError).

| Chrome | Edge | Firefox | Safari | Deno | Node.js |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ✅ | ✅ | ✅ | ✅<br />14+ | ✅ | ✅<br />15.0.0+ |


## Installation

### npm

```console
$ npm i @i-xi-dev/pubsub@2.0.17
```

```javascript
import { PubSub } from "@i-xi-dev/pubsub";
```

### CDN

Example for Skypack
```javascript
import { PubSub } from "https://cdn.skypack.dev/@i-xi-dev/pubsub@2.0.17";
```


## Usage

### [`Broker`](https://doc.deno.land/https://raw.githubusercontent.com/i-xi-dev/pubsub.es/2.0.17/mod.ts/~/PubSub.Broker) class

```javascript
const broker = new PubSub.Broker();
const topic1 = Symbol();
const topic2 = Symbol();

const subscriber11 = [];
const subscriber12 = [];
const subscriber21 = [];


// subscribe(
//   topic: symbol | string,
//   callback: (message?: T) => Promise<void>,
//   options?: { once?: boolean, signal?: AbortSignal }
// ): void

broker.subscribe(topic1, (message) => {
  subscriber11.push(message);
});
const callback12 = (message) => {
  subscriber12.push(message);
};
broker.subscribe(topic1, callback12);
broker.subscribe(topic2, (message) => {
  subscriber21.push(message);
});


// publish(
//   topic: symbol | string,
//   message?: T
// ): Promise<void>
// rejects with AggregateError, if one or more callbacks failed.

await broker.publish(topic1, "X");
// → subscriber11: [ "X" ]
//   subscriber12: [ "X" ]
//   subscriber21: []


// unsubscribe(
//   topic: symbol | string,
//   callback: (message?: T) => Promise<void>
// ): void

broker.unsubscribe(topic1, callback12);
await broker.publish(topic1, "X");
// → subscriber11: [ "X", "X" ]
//   subscriber12: [ "X" ]
//   subscriber21: []


// clear(): void

broker.clear();
await broker.publish(topic1, "X");
// → subscriber11: [ "X", "X" ]
//   subscriber12: [ "X" ]
//   subscriber21: []

```

#### Subscribe options

once: boolean
```javascript
let received = "";
broker.subscribe(topic1, (message) => {
  received = message;
}, {
  once: true,
});

await broker.publish(topic1, "Y1");
await broker.publish(topic1, "Y2");
// → received: "Y1"
```

signal: AbortSignal
```javascript
const received = [];
const controller = new AbortController();
broker.subscribe(topic1, (message) => {
  received.push(message);
}, {
  signal: controller.signal,
});

await broker.publish(topic1, "Z1");
await broker.publish(topic1, "Z2");
controller.abort();
await broker.publish(topic1, "Z3");
// → received: [ "Z1", "Z2" ]
```
npm package: @i-xi-dev/ui-pointer
Description: A PointerActivityObserver object observes pointer activities on a element. The observer generates a PointerActivity object that represents the sequence of PointerEvent objects with the same pointerId.
Author: i-xi-dev
Latest version: 1.2.2

# @i-xi-dev/ui-pointer

A `PointerActivityObserver` object observes pointer activities on a element. The observer generates a `PointerActivity` object that represents the sequence of `PointerEvent` objects with the same `pointerId`.

![Image](docs/image-1.svg)


## Reference documentation

- [`PointerActivityObserver` class](https://i-xi-dev.github.io/ui-pointer.es/reference/classes/PointerActivityObserver-1.html)
- [`PointerActivity` interface](https://i-xi-dev.github.io/ui-pointer.es/reference/interfaces/PointerActivity-1.html)


## Usage examples

- [Panning by pointermove](https://i-xi-dev.github.io/ui-pointer.es/example/pan.html)
- [Curosr proximity detection](https://i-xi-dev.github.io/ui-pointer.es/example/proximity.html)

Examples of use with Vue.js are as follows

- [Pointer activity visualizer](https://i-xi-dev.github.io/ui-pointer.es/example/visualizer.html)
npm package: @i-xi-dev/url
Description: A JavaScript immutable object that represents the normalized absolute URL.
Author: i-xi-dev
Latest version: 3.1.23

# @i-xi-dev/url

A JavaScript immutable object that represents the normalized absolute [URL](https://url.spec.whatwg.org/).


## Requirement

This module delegates the URL parsing to the [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL).

| Chrome | Edge | Firefox | Safari | Deno | Node.js |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |


## Installation

### npm

```console
$ npm i @i-xi-dev/url@3.1.23
```

```javascript
import { Uri } from "@i-xi-dev/url";
```

### CDN

Example for UNPKG
```javascript
import { Uri } from "https://www.unpkg.com/@i-xi-dev/url@3.1.23/esm/mod.js";
```


## Usage

### [`Uri.Absolute`](https://doc.deno.land/https://raw.githubusercontent.com/i-xi-dev/url.es/3.1.23/mod.ts/~/Uri.Absolute) class

For URL rendering

```javascript
const url = Uri.Absolute.fromString("http://xn--eckwd4c7cu47r2wf.jp/foo/bar?p1=%E5%80%A41&p2=%E5%80%A42#%E7%B4%A0%E7%89%87");

url.scheme;
// → "http"

url.rawHost;
// → "xn--eckwd4c7cu47r2wf.jp"

url.host;
// → "ドメイン名例.jp"

url.port;
// → 80

url.rawPath;
// → "/foo/bar"

url.path;
// → [ "foo", "bar" ]

url.rawQuery;
// → "p1=%E5%80%A41&p2=%E5%80%A42"

url.query;
// → [ [ "p1", "値1" ], [ "p2", "値2" ] ]

url.rawFragment;
// → "%E7%B4%A0%E7%89%87"

url.fragment;
// → "素片"

```

## Examples

- [URL parse from string](https://i-xi-dev.github.io/url.es/example/components_from_url.html)