open-index/open-npm huggingface dataset:
npm package: @lichiphen/nagimemo-updater
Description: NagiMemo Updater script for TEGALOG
Author: Lichiphen
Latest version: 1.0.2

# NagiMemo Updater

てがろぐ用スキン「NagiMemo」をGitHubから自動更新するためのPHPスクリプトです。

## 使い方

1. `nagimemo_update.php` を `tegalog.cgi` と同じディレクトリに配置してください。
2. ブラウザでアクセスし、画面の指示に従ってアップデートを行ってください。

## セキュリティ設定

ファイル冒頭の `$update_password` を任意のものに書き換えて使用することを推奨します。

## 配布元

- GitHub: [Lichiphen/NagiMemo](https://github.com/Lichiphen/NagiMemo)
npm package: @lichongbing/winter-sweet-ui
Description: [![Build Status](https://badgen.net/travis/lichongbing/winter-sweet-ui/main)](https://travis-ci.com/lichongbing/winter-sweet-ui) [![NPM Download](https://badgen.net/npm/dm/@lichongbing/winter-sweet-ui)](https://www.npmjs.com/package/@lichongbing/winter-sw
Author: https://github.com/lichongbing
Latest version: 1.0.4

# winter-sweet-ui

[![Build Status](https://badgen.net/travis/lichongbing/winter-sweet-ui/main)](https://travis-ci.com/lichongbing/winter-sweet-ui)
[![NPM Download](https://badgen.net/npm/dm/@lichongbing/winter-sweet-ui)](https://www.npmjs.com/package/@lichongbing/winter-sweet-ui)
[![NPM Version](https://badge.fury.io/js/%40lichongbing%2Fwinter-sweet-ui.svg)](https://www.npmjs.com/package/@lichongbing/winter-sweet-ui)
[![NPM License](https://badgen.net/npm/license/@lichongbing/winter-sweet-ui)](https://github.com/lichongbing/winter-sweet-ui/blob/main/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/lichongbing/winter-sweet-ui/pulls)
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)

short description + sample image(png/gif/mp4)

## Table of Contents

- [Introduction](#introduction)
- [Features](#features)
- [Install](#install)
- [Usage](#usage)
- [Links](#links)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [License](#license)

## Introduction

If there is no more words to write, this section can be deleted.

[⬆ Back to Top](#table-of-contents)

## Features

[⬆ Back to Top](#table-of-contents)

## Install

[⬆ Back to Top](#table-of-contents)

## Usage

[⬆ Back to Top](#table-of-contents)

## Links

- [docs](https://lichongbing.github.io/winter-sweet-ui/)

[⬆ Back to Top](#table-of-contents)

## Contributing

For those who are interested in contributing to this project, such as:

- report a bug
- request new feature
- fix a bug
- implement a new feature

Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/main/CONTRIBUTING.md).

[⬆ Back to Top](#table-of-contents)

## Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

[⬆ Back to Top](#table-of-contents)

## License

[MIT](./LICENSE)


[⬆ Back to Top](#table-of-contents)
npm package: @lichr/ngx-mat-datetime-picker
Description: Angular Material Datetime Picker
Author: HO Hong Quan
Latest version: 1.0.3

# Ngx Material DatetimePicker, Timepicker for @angular/material 7.x, 8.x

[![Build Status](https://travis-ci.com/h2qutc/ngx-mat-datetime-picker.svg?branch=master)](https://travis-ci.com/h2qutc/ngx-mat-datetime-picker)
[![codecov](https://codecov.io/gh/h2qutc/ngx-mat-datetime-picker/branch/master/graph/badge.svg)](https://codecov.io/gh/h2qutc/ngx-mat-datetime-picker)
[![License](https://img.shields.io/npm/l/ngx-mat-datetime-picker.svg)](https://www.npmjs.com/package/ngx-mat-datetime-picker)
[![npm version](https://badge.fury.io/js/ngx-mat-datetime-picker.svg)](https://badge.fury.io/for/js/ngx-mat-datetime-picker)

## Description

A DatetimePicker like @angular/material [Datepicker](https://material.angular.io/components/datepicker/overview) by adding support for choosing time.

## DEMO
@see [Demo here](https://stackblitz.com/edit/demo-ngx-mat-datetime-picker)

![Alt Text](demo.png)

## Getting started
```
npm install --save ngx-mat-datetime-picker
```

## Setup
Basically the same way the @angular/material Datepicker is configured and imported.

```
import { NgxMatDatetimePickerModule, NgxMatTimepickerModule } from 'ngx-mat-datetime-picker';
@NgModule({
   ...
   imports: [
      BrowserModule,
      HttpClientModule,
      BrowserAnimationsModule,
      MatDatepickerModule,
      MatInputModule,
      NgxMatTimepickerModule,
      FormsModule,
      ReactiveFormsModule,
      MatButtonModule,
      NgxMatDatetimePickerModule,
   ],
   ...
})
export class AppModule { }
```
@see [src/app/app.module.ts](src/app/app.module.ts)

## Using the component

The same API as @angular/material Datepicker (@see [API docs](https://material.angular.io/components/datepicker/api))

Datetime picker using FormControl

```
<mat-form-field>
    <input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date" [formControl]="dateControl">
    <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
    <ngx-mat-datetime-picker #picker></ngx-mat-datetime-picker>
</mat-form-field>
```

Timepicker

```
<ngx-mat-timepicker [(ngModel)]="date"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [disabled]="disabled"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [stepHour]="2" [stepMinute]="5" [stepSecond]="10"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [showSpinners]="showSpinners"></ngx-mat-timepicker>
```

## Theming
- @see @angular/material [Using a pre-built theme](https://material.angular.io/guide/theming#using-a-pre-built-theme)
- Add the Material Design icon font to your index.html
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">
```

## License
MIT
npm package: @lichr/three-csg-ts
Description: CSG library for use with THREE.js
Author: Jiro
Latest version: 3.1.7

# three-csg-ts

CSG (Constructive Solid Geometry) library for [three.js](https://github.com/mrdoob/three.js/) with Typescript support.

_This is a typescript rewrite of [THREE-CSGMesh](https://github.com/manthrax/THREE-CSGMesh)._

[Example](https://stackblitz.com/edit/three-csg-ts?file=index.ts)

![Screenshot 2021-07-19 at 17 32 20](https://user-images.githubusercontent.com/935782/126194933-45ac18d0-2459-4213-97d2-d46ffb67483c.png)

## Concept

CSG is the name of a technique for generating a new geometry as a function of two input geometries.

CSG is sometimes referred to as "Boolean" operators in 3d modelling packages.

Internally it uses a structure called a BSP (binary space partitioning) tree to carry out these operations.

The supported operations are .subtract, .union, and .intersect.

By using different combinations of these 3 operations, and changing the order of the input models, you can construct any combination of the input models.

## Installation

- Install with npm `npm i -save three-csg-ts`
- Install with yarn `yarn add three-csg-ts`

## Example usage

```
import * as THREE from 'three';
import { CSG } from 'three-csg-ts';

// Make 2 meshes..
const box = new THREE.Mesh(new THREE.BoxGeometry(2, 2, 2), new THREE.MeshNormalMaterial());
const sphere = new THREE.Mesh(new THREE.SphereGeometry(1.2, 8, 8));

// Make sure the .matrix of each mesh is current
box.updateMatrix();
sphere.updateMatrix();

// Perform CSG operations
// The result is a THREE.Mesh that you can add to your scene...
const subRes = CSG.subtract(box, sphere);
const uniRes = CSG.union(box, sphere);
const intRes = CSG.intersect(box, sphere);
```
npm package: @licht-77/dmm-sdk
Description: DMM Affiliate API v3 SDK for Node.js/TypeScript
Latest version: 1.1.1

# DMM Affiliate API v3 TypeScript SDK

[![npm version](https://badge.fury.io/js/@licht-77%2Fdmm-sdk.svg)](https://badge.fury.io/js/@licht-77%2Fdmm-sdk)

DMM Affiliate API v3 を TypeScript/JavaScript から簡単に利用するための非公式SDKです。

## 導入方法

npm または yarn を使用してインストールします。

```bash
npm install @licht-77/dmm-sdk
```

## 使い方

### 1. クライアントの初期化

API ID とアフィリエイト ID を指定してクライアントを初期化します。これらは DMM アフィリエイトの管理画面から取得できます。

```typescript
import { DmmApiClient } from '@licht-77/dmm-sdk';

const client = new DmmApiClient({
  apiId: 'YOUR_API_ID',         // あなたのAPI IDに置き換えてください
  affiliateId: 'YOUR_AFFILIATE_ID', // あなたのアフィリエイト ID に置き換えてください
  // baseUrl: 'https://api.dmm.com/affiliate/v3', // 任意: APIベースURL
});
```

### 2. APIの呼び出し

#### 商品検索 (ItemList)

```typescript
async function searchItems() {
  try {
    const params = {
      site: 'FANZA', // 検索対象サイト ('DMM.com' | 'FANZA')
      service: 'digital', // 検索対象サービス (任意)
      floor: 'videoa',    // 検索対象フロア (任意)
      hits: 10,          // 取得件数 (デフォルト: 20, 最大: 100)
      offset: 1,         // 検索開始位置 (デフォルト: 1)
      sort: 'rank',      // ソート順 (任意)
      keyword: 'キーワード', // 検索キーワード (任意)
      // 絞り込み（配列のみ対応）
      article: ['genre', 'actress'],
      article_id: ['6003', '15187'],
      // ... その他、API仕様で定義されているパラメータ
    };
    const response = await client.getItemList(params);

    console.log('検索結果:', response.items);
    console.log('総件数:', response.total_count);

  } catch (error) {
    console.error('商品検索エラー:', error);
  }
}

searchItems();
```

補足: `article`/`article_id` は配列のみ対応です。SDKはクエリを `article[0]=genre&article[1]=actress&article_id[0]=6003&article_id[1]=15187` の形式でエンコードします。

#### フロア一覧取得 (FloorList)

```typescript
async function getFloors() {
  try {
    const response = await client.getFloorList();
    console.log('フロア一覧:', response.site);
  } catch (error) {
    console.error('フロア一覧取得エラー:', error);
  }
}

getFloors();
```

#### その他の検索API

女優検索 (`searchActress`), ジャンル検索 (`searchGenre`), メーカー検索 (`searchMaker`), シリーズ検索 (`searchSeries`), 作者検索 (`searchAuthor`) も同様の形式で利用できます。

```typescript
// 例: 女優検索
async function searchActresses() {
  try {
    const params = {
      initial: 'あ', // 頭文字 (任意)
      actress_id: '12345', // 女優ID (任意)
      keyword: '女優名', // キーワード (任意)
      hits: 5,
      offset: 1,
    };
    const response = await client.searchActress(params);
    console.log('女優検索結果:', response.actress);
  } catch (error) {
    console.error('女優検索エラー:', error);
  }
}

searchActresses();
```

各APIの詳細なパラメータについては、[DMM Affiliate API v3 の公式ドキュメント](https://affiliate.dmm.com/api/)を参照してください。

## 型定義

各APIのリクエストパラメータとレスポンスの型定義も提供されています。TypeScriptプロジェクトで型チェックの恩恵を受けることができます。

```typescript
import { ItemListRequestParams, ItemListResponse, Item } from '@licht-77/dmm-sdk';
```

## ライセンス

[MIT](./LICENSE)
npm package: @lichtblick/avl
Description: Adelson-Velsky-Landis (AVL) self-balancing binary trees in TypeScript
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/avl

> _Adelson-Velsky-Landis (AVL) self-balancing binary trees in TypeScript_

## Introduction

[AVL trees](https://en.wikipedia.org/wiki/AVL_tree) are self-balancing binary trees that are commonly used to implement sorted sets. In addition to the common insertion, deletion, and retrieval operations, this implementation also supports range queries, greater than, and less than searches.

## Usage

```Typescript
import { AVLTree } from "@lichtblick/avl";

const tree = new AVLTree<number, string>();
tree.set(0, "zero");
tree.set(1, "1");
tree.set(1, "one");
tree.set(3, "three");
tree.set(2, "two");
tree.delete(0);
console.log(tree.has(0)); // false
console.log(tree.get(1)); // "one"
console.log(tree.size); // 3
console.log(tree.minEntry()); // [1, "one"]
console.log(tree.maxEntry()); // [3, "three"]
console.log(tree.findLessThan(2)); // [1, "one"]
console.log(tree.findGreaterThanOrEqual(2)); // [2, "two"]
tree.forEach((value, key) => console.log(value)); // "one" "two" "three"
tree.range(2, 3, (value, key) => console.log(value)); // "two" "three"
console.log(tree.pop()); // [3, "three"]
console.log(tree.shift()); // [1, "one"]
tree.clear();

// Use a custom comparator for non-Number keys
const bigintTree = new AVLTree<bigint, string>((a, b) => Number(a - b));
bigintTree.set(1n, "one");
```

## Alternatives

[avl](https://github.com/w8r/avl) - Optional support for duplicate keys, but return values can mutate after delete() calls, missing range query optimization, no find\[Less/Greater\]Than\[OrEqual\] queries, no iterators, and naming conventions do not follow ES6 container patterns.

## License

@lichtblick/avl is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/cdr
Description: Common Data Representation serialization and deserialization library
Author: Lichtblick
Latest version: 1.0.1

# @lichtblick/cdr

> _Common Data Representation serialization and deserialization library_

[![npm version](https://img.shields.io/npm/v/@lichtblick/cdr.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/cdr)

## Introduction

Common Data Representation (CDR) defines a serialization format for primitive types. When combined with an Interface Definition Language (IDL) it can be used to create complex types that can be serialized to disk, transmitted over the network, etc. while transparently handling endianness and alignment requirements. It's specified by https://www.omg.org/spec/DDSI-RTPS/2.3/PDF (chapter 10) and https://www.omg.org/cgi-bin/doc?formal/02-06-51.

XCDR implementation follows [DDS-XTypes V1.3 specification](https://www.omg.org/spec/DDS-XTypes/1.3/PDF).

CDR is found in OMG DDS (Data Distributed Service) implementations such as the Real-Time Publish Subscribe (RTPS) protocol. This is the wire protocol found in ROS2, and CDR is the default serialization format used in rosbag2.

## Usage

```Typescript
import { CdrReader, CdrSizeCalculator, CdrWriter } from "@lichtblick/cdr";

const calc = new CdrSizeCalculator();
calc.int8();
calc.uint8();
calc.int16();
calc.uint16();
calc.int32();
calc.uint32();
calc.int64();
calc.uint64();
calc.float32();
calc.float64();
calc.string("abc".length);
calc.sequenceLength();
console.log(calc.size);

const writer = new CdrWriter();
writer.int8(-1);
writer.uint8(2);
writer.int16(-300);
writer.uint16(400);
writer.int32(-500_000);
writer.uint32(600_000);
writer.int64(-7_000_000_001n);
writer.uint64(8_000_000_003n);
writer.float32(-9.14);
writer.float64(1.7976931348623158e100);
writer.string("abc");
writer.sequenceLength(0);

const reader = new CdrReader(writer.data);
console.log(reader.int8());
console.log(reader.uint8());
console.log(reader.int16());
console.log(reader.uint16());
console.log(reader.int32());
console.log(reader.uint32());
console.log(reader.int64());
console.log(reader.uint64());
console.log(reader.float32());
console.log(reader.float64());
console.log(reader.string());
console.log(reader.sequenceLength());
```

## Alternatives

[jscdr](https://github.com/atolab/jscdr) - Does not support bigint, pre-allocated buffers, or buffer length calculations.

## License

@lichtblick/cdr is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/crc
Description: Fast CRC32 computation in TypeScript
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/crc

Fast CRC32 computation in TypeScript

[![npm version](https://img.shields.io/npm/v/@lichtblick/crc)](https://www.npmjs.com/package/@lichtblick/crc) ![](https://img.shields.io/badge/dependencies-0-green)

## Introduction

A [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) (CRC) is a calculation used to detect errors in data transmission.

This library implements **CRC32**, the standard 32-bit CRC using the binary polynomial `0xEDB88320`. This is the same algorithm used in [PNG](https://www.w3.org/TR/2003/REC-PNG-20031110/#D-CRCAppendix), [zlib](https://refspecs.linuxbase.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/zlib-crc32-1.html), and other popular applications.

## Interface

The following functions are exported from this package:

```ts
function crc32Init(): number;
function crc32Update(prev: number, data: ArrayBufferView): number;
function crc32Final(prev: number): number;

function crc32(data: ArrayBufferView): number;
```

Note: Since the CRC algorithm works with unsigned data, the `crc32` and `crc32Final` functions always return **non-negative** numbers. For example, CRC32(0x01) returns 2768625435 rather than -1526341861.

## Usage

```ts
import { crc32 } from "@lichtblick/crc";

const data = new Uint8Array(...);

const crc = crc32(data);
```

```ts
import { crc32Init, crc32Update, crc32Final } from "@lichtblick/crc";

let crc = crc32Init();
while (/* more data available */) {
  crc = crc32Update(crc, data);
}
crc = crc32Final(crc);
```

## Benchmarks

This package achieves a >5x performance improvement over many other CRC packages, because of the multi-byte algorithms used (adapted from https://github.com/komrad36/CRC).

The following benchmarks were recorded on a MacBook Pro with an M1 Pro chip and 16GB of RAM. Each iteration ("op") is processing 1MB of data.

```
$ yarn bench
...
  crc:
    355 ops/s, ±0.56%     | 81.52% slower

  node-crc:
    376 ops/s, ±0.14%     | 80.43% slower

  crc-32:
    1 057 ops/s, ±0.16%   | 44.98% slower

  polycrc:
    327 ops/s, ±0.21%     | slowest, 82.98% slower

  this package:
    1 921 ops/s, ±0.18%   | fastest
```

## References

For further information about CRCs and their computation, see:

- https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks
- https://github.com/komrad36/CRC
- https://create.stephan-brumme.com/crc32/
- https://zlib.net/crc_v3.txt
- https://github.com/Michaelangel007/crc32
- https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-abs/06966aa2-70da-4bf9-8448-3355f277cd77

## License

@lichtblick/crc is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/electron-socket
Description: Networking sockets for Electron apps
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/electron-socket

Networking sockets for Electron apps

[![npm version](https://img.shields.io/npm/v/@lichtblick/electron-socket.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/electron-socket)

## Introduction

Raw sockets are not supported in browser contexts, even in Electron apps. To overcome this limitation, this package uses RPC between the Electron renderer context (referred to in this package as the "renderer" and in Electron documentation as "main world") and the preloader (referred to in Electron documentation as "isolated world" when running with `contextIsolation: true`) to expose TCP/UDP sockets and server classes in the renderer context. The API somewhat resembles `net.Socket`/`dgram.Socket` and `net.Server` from node.js, with Promise-based methods since these classes are built on asynchronous RPC.

## Usage

```ts
// preload.ts ////////////////////////////////////////////////////////////////
import { PreloaderSockets } from "@lichtblick/electron-socket/preloader";

PreloaderSockets.Create();
```

```ts
// renderer.ts ///////////////////////////////////////////////////////////////
import { Sockets } from "@lichtblick/electron-socket/renderer";

async function main() {
  const net = await Sockets.Create();

  const server = await net.createServer();
  server.on("connection", (client) => {
    client.write(new Uint8Array([42]));
  });
  server.listen(9000);

  const socket = await net.createSocket();
  socket.on("data", (data: Uint8Array) => console.log(`Server sent ${data}`));
  socket.connect({ port: 9000, host: "localhost" });
}

main();
```

## License

@lichtblick/electron-socket is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Development

### Testing

A small example Electron app is provided in the [example](example) directory, which can be used for manual testing. Run it using `yarn example`.

### Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/eslint-plugin
Description: Lichtblick ESLint rules and configuration
Latest version: 2.0.7

# @lichtblick/eslint-plugin

[![npm package](https://img.shields.io/npm/v/@lichtblick/eslint-plugin)](https://www.npmjs.com/package/@lichtblick/eslint-plugin)

Lichtblick default eslint configuration & rules.

Please err on the side of conservative changes to this repo - multiple Lichtblick projects should adopt a change before making it a default.

## Rules

See [rules/README.md](rules/README.md) for details on each rule.

## Installation

The following configurations are available:

- `plugin:@lichtblick/base`
- `plugin:@lichtblick/jest`
- `plugin:@lichtblick/react`
- `plugin:@lichtblick/typescript`

**Typescript + React Example**

```sh
yarn add -D \
    @lichtblick/eslint-plugin \
    @typescript-eslint/eslint-plugin \
    @typescript-eslint/parser \
    eslint \
    eslint-config-prettier \
    eslint-plugin-es \
    eslint-plugin-filenames \
    eslint-plugin-import \
    eslint-plugin-jest \
    eslint-plugin-prettier \
    eslint-plugin-react \
    eslint-plugin-react-hooks \
    prettier
```

In your `.eslintrc.js`:

```js
module.exports = {
  extends: [
    "plugin:@lichtblick/base",
    "plugin:@lichtblick/jest",
    "plugin:@lichtblick/react",
  ],
  overrides: [
    {
      files: ["*.ts", "*.tsx"],
      extends: ["plugin:@lichtblick/typescript"],
      parserOptions: {
        project: "tsconfig.json",
      },
    },
  ],
};
```

You can add `"plugin:@lichtblick/typescript"` to the top level `extends` instead of using `overrides` if your project contains no `.js` files.

## License Header Rule Configuration

To use the license-header rule, your project must specify the license type in the ESLint configuration file (`.eslintrc`). This is done by defining an object with a `licenseType` attribute that matches your project's license.

Here’s an example of how to configure it:

```js
rules:
  "@lichtblick/license-header": ["error", {licenseType: "MPL-2.0"}]
```

In this example, the `licenseType` is set to "MPL-2.0", but you should replace it with the appropriate license type for your project (e.g., "MIT", "Apache-2.0").


## License

@lichtblick/eslint-plugin is released under the [MIT License](/LICENSE.md).

## Releasing

**Note**: You must use npm 7+ (not yarn) to test this repo locally, due to the self link in `package.json`.

```sh
tag=$(npm version minor) && echo "$tag"
git push && git push origin "$tag"
```
npm package: @lichtblick/just-fetch
Description: Isomorphic ponyfill wrapping native browser fetch and node-fetch
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/just-fetch

Isomorphic ponyfill wrapping native browser fetch and node-fetch.

[![npm version](https://img.shields.io/npm/v/@lichtblick/just-fetch.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/just-fetch)

### Usage

```ts
import fetch from "@lichtblick/just-fetch";
```

Usage is the same whether you are targeting browsers or node.js. The browser
target returns the native `window.fetch` implementation, and in node.js the
`node-fetch` library is returned.

## License

@lichtblick/just-fetch is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/message-definition
Description: Defines common types for message definition schemas (ROS .msg, Protobuf, FlatBuffers, IDL, PX4 ULog, JSON Schema, etc)
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/message-definition

> Defines common TypeScript types for message definition schemas (ROS .msg, Protobuf, FlatBuffers, IDL, PX4 ULog, JSON Schema, etc).

## Why is this useful?

Several interface definition languages exist today for describing the structure of messages. These languages are often used to generate code for serialization and deserialization of messages. This package defines a common representation in TypeScript for interface definitions, sometimes referred to as message definitions, so they can be reasoned about in a generic way. A concrete example of this is in [Lichtblick Suite](https://github.com/Lichtblick-Suite/lichtblick), which supports many different message serializations but provides common functionality across all of them such as Message Path Syntax and structured message display.

## Examples

Here is a an example of a ROS 2 message definition (`.msg` file) and its corresponding TypeScript representation:

`UserAccount.msg`:

```
string username
Account account
============
MSG: custom_type/Account
string name
uint16 id
```

`UserAccount.ts`:

```typescript
[
  {
    definitions: [
      { type: "string", name: "username" },
      { type: "custom_type/Account", name: "account", isComplex: true },
    ],
  },
  {
    name: "custom_type/Account",
    definitions: [
      { type: "string", name: "name" },
      { type: "uint16", name: "id" },
    ],
  },
];
```

Note that this package only provides type definitions, not any functionality for parsing or generating message definitions. For that, see [lichtblick/rosmsg](https://github.com/Lichtblick-Suite/rosmsg) or other packages that depend on this one.

## License

@lichtblick/message-definition is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/omgidl-serialization
Description: OMG IDL Schema message serializers and deserializer
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/omgidl-serialization

> _OMG IDL message serialization, for reading and writing CDR and XCDR2 messages based on `.idl` schema_

[![npm version](https://img.shields.io/npm/v/@lichtblick/omgidl-serialization.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/omgidl-serialization)

## MessageReader

Message reader deserializes CDR, XCDR1 and XCDR2 messages into plain objects. The messages are fully deserialized.

```typescript
import { parseIDL } from "@lichtblick/omgidl-parser";
import { MessageReader } from "@lichtblick/omgidl-serialization";

const msgDef = `
  module geometry_msgs {
    struct PointStamped {
      Header header;
      Point point;
    };
  };
  struct Header {
    uint32 seq;
    Time stamp;
    string frame_id;
  };
  struct Time {
    uint32 sec;
    uint64 nsec;
  };
  struct Point {
    float x;
    float y;
    float z;
  };
`;

const messageDefinition = parseIDL(msgDef);
const reader = new MessageReader("geometry_msgs::PointStamped", messageDefinition);

// deserialize a buffer into an object
const message = reader.readMessage([0x00, 0x01, ...]);

// access message fields
message.header.stamp;
```

## MessageWriter

Convert an object, array, or primitive value into binary data using CDR message serialization. (XCDR1 and XCDR2 writing is not yet supported.)

```Typescript
import { MessageWriter } from "@lichtblick/omgidl-serialization";

const msgDef = `
  module geometry_msgs {
    struct PointStamped {
      Header header;
      Point point;
    };
  };
  struct Header {
    uint32 seq;
    Time stamp;
    string frame_id;
  };
  struct Time {
    uint32 sec;
    uint64 nsec;
  };
  struct Point {
    float x;
    float y;
    float z;
  };
`;

const messageDefinition = parseIDL(msgDef);

const writer = new MessageWriter("geometry_msgs::PointStamped", messageDefinition, cdrOptions);

// serialize the passed in object to a Uint8Array as a PointStamped message
const uint8Array = writer.writeMessage({
  header: {
    stamp: { sec: 0, nsec: 0 },
    frame_id: ""
  },
  x: 1,
  y: 0,
  z: 0
});
```

## Known Limitations

`MessageReader` does not support:

- arrays of variable-size arrays. `parseIDL` will error if this is detected in the schema to prevent incorrect deserialization.

`MessageWriter` does not support:

- does not support writing XCDR1 (`PL_CDR`) or XCDR2 (`PL_CDR2`, `DELIMITED_CDR2`) encoded messages utilizing extensible types. However we can deserialize these encapsulation kinds in `MessageReader`.

Both do not support:

- `wchar` and `wstring` - These are written and read using custom implementations that are specific to someone's environment. If encountered during deserialization, they will throw an error saying that they are unsupported.

Also see the current IDL parser schema limitations [here](../omgidl-parser/README.md#omg-idl-subset-support)
npm package: @lichtblick/ros1
Description: Standalone TypeScript implementation of the ROS 1 (Robot Operating System) protocol with a pluggable transport layer
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/ros1

> _Standalone TypeScript implementation of the ROS 1 (Robot Operating System) protocol with a pluggable transport layer_

[![npm version](https://img.shields.io/npm/v/@lichtblick/ros1.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/ros1)

## Usage

```Typescript
// An example client that connects to the ROS1 turtlesim node

import { RosNode } from "@lichtblick/ros1";
import { getEnvVar, getHostname, getNetworkInterfaces, getPid, TcpSocketNode } from "@lichtblick/ros1/nodejs";
import { HttpServerNodejs } from "@lichtblick/xmlrpc/nodejs";

async function main() {
  const name = "/testclient";
  let rosNode: RosNode | undefined;

  try {
    rosNode = new RosNode({
      name,
      rosMasterUri: getEnvVar("ROS_MASTER_URI") ?? "http://localhost:11311/",
      hostname: RosNode.GetRosHostname(getEnvVar, getHostname, getNetworkInterfaces),
      pid: getPid(),
      httpServer: new HttpServerNodejs(),
      tcpSocketCreate: TcpSocketNode.Create,
      log: console,
    });

    await rosNode.start();

    const params = await rosNode.subscribeAllParams();
    console.dir(params);

    const sub = rosNode.subscribe({
      topic: "/turtle1/color_sensor",
      dataType: "turtlesim/Color",
    });

    sub.on("message", (msg, data, pub) => {
      console.log(
        `[MSG] ${JSON.stringify(msg)} (${
          data.byteLength
        } bytes from ${pub.connection.getTransportInfo()})`,
      );
    });

    await new Promise((resolve) => setTimeout(resolve, 1000));

    console.dir(sub.getStats());
  } catch (err) {
    const msg = (err as Error).stack ?? `${err}`;
    console.error(msg);
  } finally {
    rosNode?.shutdown();
  }
}

void main();
```

### Test

`yarn test`

## License

@lichtblick/ros1 is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/ros2idl-parser
Description: Parser for ROS 2 IDL message definitions
Author: Lichtblick
Latest version: 1.0.0

# @lichtblick/ros2idl-parser

> _ROS 2 `.idl` message definition parser_

[![npm version](https://img.shields.io/npm/v/@lichtblick/ros2idl-parser.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/ros2idl-parser)

## Introduction

[The Robot Operating System (ROS)](https://www.ros.org/) defines a [supported subset of OMG IDL](https://design.ros2.org/articles/idl_interface_definition.html) for describing data types. This library parses those message definitions and can round trip them back into a canonical string format suitable for checksum generation. The parsed definitions are useful for serialization or deserialization when paired with other libraries.

## Usage

```Typescript
import { parseRos2idl } from "@lichtblick/ros2idl-parser";

const ros2idlDefinitionStr = `
================================================================================
IDL: geometry_msgs/msg/Pose

module geometry_msgs {
  module msg {
    struct Pose {
      geometry_msgs::msg::Point position;
      geometry_msgs::msg::Quaternion orientation;
    };
  };
};

================================================================================
IDL: geometry_msgs/msg/Point

module geometry_msgs {
  module msg {
    struct Point {
      double x;
      double y;
      double z;
    };
  };
};

================================================================================
IDL: geometry_msgs/msg/Quaternion

module geometry_msgs {
  module msg {
    struct Quaternion {
      double x;
      double y;
      double z;
      double w;
    };
  };
};
`;

const messageDefinition = parseRos2idl(ros2idlDefinitionStr);

// print the parsed message definition structure
console.log(JSON.stringify(messageDefinition, null, 2));
```

Prints:

```JSON
[
  {
    "definitions": [
      {
        "type": "geometry_msgs/msg/Point",
        "isArray": false,
        "name": "position",
        "isComplex": true
      },
      {
        "type": "geometry_msgs/msg/Quaternion",
        "isArray": false,
        "name": "orientation",
        "isComplex": true
      }
    ]
  },
  {
    "name": "geometry_msgs/msg/Point",
    "definitions": [
      {
        "type": "float64",
        "isArray": false,
        "name": "x",
        "isComplex": false
      },
      {
        "type": "float64",
        "isArray": false,
        "name": "y",
        "isComplex": false
      },
      {
        "type": "float64",
        "isArray": false,
        "name": "z",
        "isComplex": false
      }
    ]
  },
  {
    "name": "geometry_msgs/msg/Quaternion",
    "definitions": [
      {
        "type": "float64",
        "isArray": false,
        "name": "x",
        "isComplex": false
      },
      {
        "type": "float64",
        "isArray": false,
        "name": "y",
        "isComplex": false
      },
      {
        "type": "float64",
        "isArray": false,
        "name": "z",
        "isComplex": false
      },
      {
        "type": "float64",
        "isArray": false,
        "name": "w",
        "isComplex": false
      }
    ]
  }
]
```
npm package: @lichtblick/rosbag2
Description: ROS2 (Robot Operating System) bag reader and writer abstract implementation
Author: Lichtblick
Latest version: 1.0.6

# @lichtblick/rosbag2

> _ROS2 (Robot Operating System) legacy SQLite bag reader abstract implementation_

[![npm version](https://img.shields.io/npm/v/@lichtblick/rosbag2.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/rosbag2)

**NOTICE**: The SQLite rosbag2 recording format has been replaced by [MCAP](https://mcap.dev/). This package is only useful for reading legacy rosbag2 `.db3` files.

**Developers**: Use [@lichtblick/rosbag2-node](https://github.com/lichtblick-suite/rosbag2-node) or [@lichtblick/rosbag2-web](https://github.com/lichtblick-suite/rosbag2-web)

This package contains the subset of the full rosbag2 SQLite implementation that can be shared across node.js and web environments. It cannot read rosbag2 `.db3` files on its own. You are probably looking for the [@lichtblick/rosbag2-node](https://github.com/lichtblick-suite/rosbag2-node) or [@lichtblick/rosbag2-web](https://github.com/lichtblick-suite/rosbag2-web) package unless you are writing your own bag parsing implementation.

## License

@lichtblick/rosbag2 is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @lichtblick/rosbag2-web
Description: ROS2 (Robot Operating System) bag reader and writer for the browser
Author: Lichtblick
Latest version: 1.0.4

# @lichtblick/rosbag2-web

> _ROS 2 (Robot Operating System) bag reader for the browser 👜_

[![npm version](https://img.shields.io/npm/v/@lichtblick/rosbag2-web.svg?style=flat)](https://www.npmjs.com/package/@lichtblick/rosbag2-web)

## Introduction

`rosbag2-web` enables web browsers to read the contents of ROS 2 SQLite files. It is used by [lichtblick](https://lichtblick.dev) to support reading data in this legacy file format. This SQLite format has been superseded by [MCAP](https://mcap.dev).

## License

@lichtblick/rosbag2-web is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://lichtblick.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.