open-index/open-npm huggingface dataset:
npm package: @kamataryo/cli-radio
Description: A lightweight CLI radio button interface with no dependencies.
Author: kamataryo
Latest version: 1.0.6

# @kamataryo/cli-radio

## install

```shell
$ npm install @kamataryo/cli-radio
# or
$ yarn add @kamataryo/cli-radio
```

## usage

```typescript
// TypeScript example
import select from "@kamataryo/cli-radio";

const main = async () => {
  const answer = await select(["foo", "bar", "baz"]);
};

main();
```

```shell
# an one-liner to try `@kamataryo/cli-radio`
$ npm install @kamataryo/cli-radio && node -e "require('@kamataryo/cli-radio').default(['foo', 'bar', 'baz'])"
```

![usage](./usage.gif)
npm package: @kamataryo/eslint-config-standard
Description: My eslint standard config
Author: kamataryo
Latest version: 0.0.2

# @kamataryo/eslint-config-standard

[![Build Status](https://travis-ci.org/kamataryo/eslint-config-standard.svg?branch=master)](https://travis-ci.org/kamataryo/eslint-config-standard)

[![npm (scoped)](https://img.shields.io/npm/v/@kamataryo/eslint-config-standard.svg)](https://www.npmjs.com/package/@kamataryo/eslint-config-standard)
[![downloads](https://img.shields.io/npm/dt/@kamataryo/eslint-config-standard.svg?style=flat)](https://david-dm.org/@kamataryo/eslint-config-standard#info=devDependencies)

[![Dependency Status](https://img.shields.io/david/kamataryo/eslint-config-standard.svg?style=flat)](https://david-dm.org/@kamataryo/eslint-config-standard)
[![devDependency Status](https://img.shields.io/david/dev/kamataryo/eslint-config-standard.svg?style=flat)](https://david-dm.org/kamataryo/eslint-config-standard#info=devDependencies)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


My ESLint configuration for Node.js project.

## stacks

- ESNext syntax with babel
- Testing with mocha and chai
- `NODE_PATH` to `/src`

## install

```shell
$ npm install eslint @kamataryo/eslint-config-standard --save-dev
```

## usage

```javascript
// .eslintrc.js
module.exports = {
  extends: ['@kamataryo/eslint-config-standard']
}
```

## deployment (for commiters)

```shell
$ npm version patch -m "your patch update"
$ npm version minor -m "your minor update"
$ npm version major -m "your major update"
```
npm package: @kamataryo/gh-ogp
Description: Draw simple OGP image optimized for GitHub repository
Latest version: 0.0.5

# @kamataryo/gh-ogp

Draw simple OGP image optimized for GitHub repository

# usage

```shell
$ yarn global add @kamataryo/gh-ogp
$ cd path/to/your/Node.js/project
$ gh-ogp dark > dark_image.png
$ gh-ogp light > light_image.png
```

# development

```shell
$ git clone git@github.com:kamataryo/gh-ogp.git
$ cd gh-ogp
$ yarn
$ ./cli.js dark > test.png
$ ./cli.js light > test.png
```

# Samples

![ogp sample](./samples/01.png)
![ogp sample](./samples/02.png)
npm package: @kamataryo/inat-convex
Description: A CLI tool to generate GeoJSON polygons that enclose the convex hull of species distribution areas.
Author: kamataryo
Latest version: 1.0.15

# @kamataryo/inat-convex

A CLI tool to generate GeoJSON polygons that enclose the convex hull of species distribution areas.

## Requirements

- Node.js or Deno

## Usage example

Place a common name, taxon (genus, family, order and etc) or scientific name as an argument and you can get a GeoJSON object which streamed out from standard output of the process.

```shell
$ npx @kamataryo/inat-convex "セトウチマイマイ"          # with a Japanese common name
$ npx @kamataryo/inat-convex "Arctic Char"            # with an English common name
$ npx @kamataryo/inat-convex "Salvelinus leucomaenis" # with a scientific name
```

It is convenient to pipe to any tool which supports standard input e.g. [@geolonia/view-geojson](https://github.com/geolonia/view-geojson).

```shell
$ npx @kamataryo/inat-convex "セトウチマイマイ" | npx @geolonia/view-geojson
```

### (Option) with Deno

```shell
$ git clone git@github.com:kamataryo/inat-convex.git
$ cd inat-convex
$ deno run ./src/shims/deno.ts
```

### more samples

|||
|---|---|
|<span class="italic" style="font-style:italic">Euhadra quaesita</span> (ヒダリマキマイマイ)|<span class="italic" style="font-style:italic">Euhadra subnimbosa</span> (セトウチマイマイ)|
|![](https://kamataryo.github.io/inat-convex/ヒダリマキマイマイ.png)|![](https://kamataryo.github.io/inat-convex/セトウチマイマイ.png)|
|`$ npx @kamataryo/inat-convex "ヒダリマキマイマイ" \| npx @geolonia/view-geojson` | `$ npx @kamataryo/inat-convex "セトウチマイマイ" \| npx @geolonia/view-geojson`|
|Arctic Char (ホッキョクイワナ)|Char (イワナ)|
|![](https://kamataryo.github.io/inat-convex/arctic%20char.png)|![](https://kamataryo.github.io/inat-convex/salvelinus%20leucomaenis.png)|
|`$ npx @kamataryo/inat-convex "Arctic Char" \| npx @geolonia/view-geojson`|`$ npx @kamataryo/inat-convex "salvelinus leucomaenis" \| npx @geolonia/view-geojson`|

### Note

### Quality of data

The output distribution area is just a convex of sampled observation points and does not reflect detailed.

### Resources

This tool makes a maximum of 5 HTTP requests / 5 seconds / 1 command execution against `www.inaturalist.org` from your environment. and please note the iNaturalist [rate limit](https://www.inaturalist.org/pages/api+recommended+practices). We have not yet implemented an authentication flow using the iNaturalist API tokens. If you are interested in, please [submit an issue](https://github.com/kamataryo/inat-convex/issues/new/choose) or [a pull request](https://github.com/kamataryo/inat-convex/compare).

## Acknowledgments

This tool wraps [iNaturalist API](https://www.inaturalist.org/pages/api+reference).
I would like to thanks to all iNaturalist users and the great platform.
npm package: @kamataryo/mermaid-js__parser
Description: MermaidJS parser
Author: Yokozuna59
Latest version: 0.6.3

<p align="center">
<img src="https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height="150">

</p>
<h1 align="center">
Mermaid Parser
</h1>

<p align="center">
Mermaid parser package
<p>

[![NPM](https://img.shields.io/npm/v/@mermaid-js/parser)](https://www.npmjs.com/package/@mermaid-js/parser)

## How the package works

The package exports a `parse` function that has two parameters:

```ts
declare function parse<T extends DiagramAST>(
  diagramType: keyof typeof initializers,
  text: string
): T;
```

## How does a Langium-based parser work?

```mermaid
sequenceDiagram
actor Package
participant Module
participant TokenBuilder
participant Lexer
participant Parser
participant ValueConverter


Package ->> Module: Create services
Module ->> TokenBuilder: Override or/and<br>reorder rules
TokenBuilder ->> Lexer: Read the string and transform<br>it into a token stream
Lexer ->> Parser: Parse token<br>stream into AST
Parser ->> ValueConverter: Clean/modify tokenized<br>rules returned value
ValueConverter -->> Package: Return AST
```

- When to override `TokenBuilder`?
  - To override keyword rules.
  - To override terminal rules that need a custom function.
  - To manually reorder the list of rules.

- When to override `Lexer`?
  - To modify input before tokenizing.
  - To insert/modify tokens that cannot or have not been parsed.

- When to override `LangiumParser`?
  - To insert or modify attributes that can't be parsed.

- When to override `ValueConverter`?
  - To modify the returned value from the parser.
npm package: @kamataryo/nicediff
Description: Instant image diff tool.
Author: kamataryo
Latest version: 0.0.3

# @kamataryo/nicediff

Instant image diff tool.

## Usage

```shell
$ npm install @kamataryo/nicediff -g
$ nicediff img1.png img2.png > diff.png
```

```shell
# If you use npx, (y/n) prevents the execution, so add -y option.
$ npx -y @kamataryo/nicediff img1.png img2.png > diff.png
```
npm package: @kamataryo/outdent
Description: A simple here document generator with pretty indents
Latest version: 2.0.1

# outdent

Outdent is a simple here document generator with pretty indents.

## install

```shell
$ npm install @kamataryo/outdent
# or
$ yarn add @kamataryo/outdent
# or
$ bun install @kamataryo/outdent
```

## usage

```typescript
import { test, expected } from 'bun:test'

test('the example in README', () => {
  let expected, actual
  {
    {
      {
        // not pretty 🤔
        expected = `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`
      }
    }
  }

  {
    {
      {
        // pretty 🥺
        actual = outdent`
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
          Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
          Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
          Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      `
      }
    }
  }

  expect(actual).toBe(expected)
})
```
npm package: @kamataryo/prop-id-cli
Description: ## Setup
Author: kamataryo
Latest version: 0.0.4

# Prop ID CLI

## Setup

```shell
# authentication information
PROP_ID_API_KEY=aaaa
PROP_ID_ACCESS_TOKEN=bbbb
```

## Usage

```shell
# with CLI arguments
$ npx prop-id-cli '13-0123-4567-89ab-cdef'
# with STDIN
$ echo '13-0123-4567-89ab-cdef' | npx prop-id-cli
```
npm package: @kamataryo/sandbox-same-site-cookies
Description: An instant server to try the SameSite cookie attribute.
Author: kamataryo
Latest version: 1.0.2

# @kamataryo/sandbox-same-site-cookies

This is an instant server to try `SameSite=Strict|Lax|None` cookies.

** CAUTION **
This program requires privilege to run.
Be aware what you are doing and execute with on your lisk.

## usage

You can try with:

```shell
$ sudo npx @kamataryo/sandbox-same-site-cookies
# or
$ git clone git@github.com:kamataryo/sandbox-same-site-cookies.git
$ cd sandbox-same-site-cookies
$ sudo npm start
```

Then open [http://strict.test](http://strict.test).

![screenshot](screenshot.png)

## Q&A

- Q: Why is `sudo` required?
- A: This command edit the `/etc/hosts` to use multiple local domains. See [bin.sh](./bin.sh) for details.

- Q: How can I try `SameSite`?
- A:
  1. login at http://strict.test/login first
  2. Move to http://stirict.test with `GET` and you will see a login header
  3. Move to http://none.test with `GET`
  4. Move to http://strict.test with `GET` again and you will miss the login header, i.e. the cookie is not used
  5. login at http://lax.test/login next
  6. Move to http://lax.test with `GET` and you will see the login header
  7. Move to http://none.test with `GET`
  8. Move to http://lax.test with `GET` again and you will see the login header again, i.e. the cookie is used
  9. However, if you use `POST` to move, you will miss the login header, i.e. the cookie is not used
npm package: @kamataryo/symbol-function
Description: Function object safe for bracket suffix
Author: kamataryo
Latest version: 1.0.1

# SymbolFunction

[![npm version](https://badge.fury.io/js/%40kamataryo%2Fsymbol-function.svg)](https://badge.fury.io/js/%40kamataryo%2Fsymbol-function)
[![Build Status](https://travis-ci.org/kamataryo/symbol-function.svg?branch=master)](https://travis-ci.org/kamataryo/symbol-function)

SymbolFunction can be used as a function and bracket suffix safely.

## install

```shell
$ yarn add @kamataryo/symbol-function
# or
$ npm insall @kamataryo/symbol-function
```

## usage

```javascript
// it works as a Function'
const func = new SymbolFunction(() => 'xyz')
func() // 'xyz'
})

// it can be used as bracket suffix
const func1 = new SymbolFunction(() => {})
const func2 = new SymbolFunction(() => {})
const obj = {}
obj[func1] = 123
obj[func2] = 234

obj[func1] // 123
obj[func2] // 234
```
npm package: @kamataryo/tri-coords
Description: 三角形の3辺の長さから座標を計算するCLIツール
Author: kamataryo
Latest version: 1.0.0

# @kamataryo/tri-coords

三角形の3辺の長さから座標を計算するCLIツール

## 概要

このツールは、三角形の3辺の長さ（AB, BC, CA）を入力として受け取り、以下の条件で座標を計算します：

- 点A: 原点 (0, 0)
- 点B: x軸上の点 (AB, 0)
- 点C: 3辺の長さから計算される点

## インストール

```bash
npm install -g @kamataryo/tri-coords
```

## 使い方

基本的な使い方：

```bash
tri-coords <AB> <BC> <CA>
```

### 引数

- `<AB>`: 辺ABの長さ（点Aを原点とし、点Bをx軸上に配置）
- `<BC>`: 辺BCの長さ
- `<CA>`: 辺CAの長さ

### オプション

- `-d, --decimals <number>`: 出力する座標の小数点以下の桁数（デフォルト: 6）
- `-h, --help`: ヘルプを表示
- `-V, --version`: バージョンを表示

## 例

```bash
# 基本的な使用例
$ tri-coords 3 4 5
点B: { x: 3, y: 0 }
点C: { x: 0.5, y: 4.33013 }

# 小数点以下の桁数を指定
$ tri-coords 5 5 5 --decimals 2
点B: { x: 5, y: 0 }
点C: { x: 2.5, y: 4.33 }
```

## 仕組み

このツールは、三角形の3辺の長さから余弦定理を使用して点Cの座標を計算します。

1. 点Aを原点(0, 0)とします
2. 点Bをx軸上の点(AB, 0)とします
3. 余弦定理を使用して角度∠BAC（点Aでの角度）を計算します：
   - cos(∠BAC) = (AB² + CA² - BC²) / (2 * AB * CA)
4. この角度と辺CAの長さを使用して、点Cの座標を計算します：
   - C_x = CA * cos(∠BAC)
   - C_y = CA * sin(∠BAC)

## 三角形の成立条件

このツールは、入力された3辺の長さが三角形の成立条件を満たしているかチェックします：

1. すべての辺の長さは正の値である必要があります
2. 任意の2辺の和は残りの1辺より大きい必要があります（三角不等式）

これらの条件を満たさない場合、エラーメッセージが表示されます。

## ライセンス

MIT
npm package: @kamataryo/utf8fy
Description: A stream to decode as SHIFT_JIS and encode as UTF-8.
Author: kamataryo
Latest version: 1.0.3

# @kamataryo/utf8fy

A stream to decode as SHIFT_JIS and encode as UTF-8.

## Usage

```shell
$ cat shift_jis.text | npx @kamataryo/utf8fy | utf-8.text
```

```javascript
import Utf8fyStream from "@kamataryo/utf8fy";
process.stdin.pipe(new Utf8fyStream()).pipe(process.stdout);
```
npm package: @kamataryo/vargraph
Description: A simple JavaScript variable analyzer
Author: kamataryo
Latest version: 0.0.2

# @kamataryo/vargraph

[![Build Status](https://travis-ci.org/kamataryo/vargraph.svg?branch=master)](https://travis-ci.org/kamataryo/vargraph)
A simple JavaScript variable analyzer.

# usage

## JavaScript library

```javascript
import vargraph from '@kamataryo/vargraph'

const code = `
  const a = 1
  const b = a + 1
`

vargraph(code)
// {
//   a: { incomes: ['b'], outcomes: [] },
//   b: { incomes: [], outcomes: ['a'] }
// }
```

## CLI

```shell
$ npx @kamataryo/vargraph path/to/code.js
```
npm package: @kamatte-me/npm-sandbox
Description: My sandbox project
Author: kamatte-me
Latest version: 0.7.6

# @kamatte-me/npm-sandbox

My NPM sandbox project.

Build ESM / CJS package with TypeScript.

## Tools

- pnpm
- Vite
- Vitest
- Biome
- Renovate
- GitHub Actions
- [Changesets](https://github.com/changesets/changesets)
- [publint](https://publint.dev/)

## Getting Started 🚀

1. Create a new GitHub repository
2. Download this repository
3. Modify the Release Workflow in [`.github/workflows/release.yml`](./.github/workflows/release.yml)
   ```diff
   - branches:
   -   - main
   + branches-ignore:
   +   - '**'
   ```
4. Modify the Changesets config in [`.changeset/config.json`](./.changeset/config.json)
   ```diff
   - { "repo": "kamatte-me/npm-sandbox" }
   + { "repo": "<your-org>/<your-repo>" }
   ```
5. Update the following package information in [`package.json`](./package.json)
   - `name`
   - `version`: `0.0.0`
   - `description`
   - `keywords`
   - `homepage`
   - `repository`
   - `license`
   - `author`
6. Update [`README.md`](./README.md)
7. Update [`LICENSE`](./LICENSE)
8. Push to GitHub
   ```shell
   git init
   git add --all
   git commit -m "first commit"
   git branch -M main
   git remote add origin git@github.com:<user>/<repo>.git
   git push -u origin main
   ```
9. Configure GitHub repository `Settings`
   - `Actions` > `General` > `Workflow permissions`
     - Enable `Allow GitHub Actions to create and approve pull requests`
   - `Secrets and variables` > `Actions` > `New repository secret`
     - `NPM_TOKEN`: Your NPM Granular Access Token
10. Install the following GitHub Apps
    - [changeset-bot](https://github.com/apps/changeset-bot)
    - [Renovate](https://github.com/settings/installations/32087651)
    - [renovate-approve](https://github.com/settings/installations/32308587)
11. **DEVELOP YOUR LIBRARY**
12. First Release 🎉
    1. Set the `version` in [`package.json`](./package.json)
    2. Revert the [`.github/workflows/release.yml`](./.github/workflows/release.yml) changes

### After First Release

#### For each Pull Request

1. Before merging a pull request, either run `pnpm changeset` or follow the comments from changeset-bot on the pull request, decide on the release type and write the release notes.
2. Confirm that the changeset-bot has commented `🦋 Changeset detected` on the pull request before merging.
3. Merge the pull request.

#### For each release

Merge the pull request titled `Version Packages`.
npm package: @kamavinga/react-use-translation
Description: A simple React hook for handling translations and language switching with memoization.
Author: Your Name
Latest version: 1.0.4

# react-use-translation

## Description

**react-use-translation** is a lightweight and customizable React hook for managing translations and language switching in your React applications. With support for memoization, lazy loading of translation files, and dynamic language switching, this package helps you easily implement internationalization (i18n) in your React app without the need for complex configuration.

Simply pass the desired language namespace and key to the hook, and it will return the correct translation. You can also easily manage your language preference with URL path-based locale detection and localStorage support.

## Installation

To install **react-use-translation** in your project, run the following command:
 
```npm install @kamavinga/react-use-translation```
or
```yarn add @kamavinga/react-use-translation```


## Adding Translation Files

For `@kamavinga/react-use-translation` to work correctly in your project, you need to add the translation files for the languages your app supports.

### Translation File Structure:

You should create JSON files for each language you want to support. Each file will contain translations grouped by **namespace** (such as `home` or `dashboard`).

#### Steps to Add Translation Files:

1. Create a `translations` folder in the root of your project.
2. Add JSON files for each language, for example:
   - `en.json` (for English)
   - `ar.json` (for Arabic)

#### Example of `en.json` File (for English):

```json
{
  "home": {
    "hello": "Hello",
    "welcome": "Welcome to our application"
  },
  "about": {
    "description": "This is a React app that supports multiple languages."
  }
}
```

## Usage Example

Below is an example of how to use the `@kamavinga/react-use-translation` package in your React application. This example demonstrates how to toggle between languages and display translated text.

```javascript
import React from 'react';
import useTranslation from '@kamavinga/react-use-translation';

const App = () => {
  const { translate, changeLanguage } = useTranslation("home");

  return (
    <div>
      {/* Button to change language to English */}
      <button onClick={() => changeLanguage("en")}>English</button>
      
      {/* Button to change language to Arabic */}
      <button onClick={() => changeLanguage("ar")}>Arabic</button>

      {/* Displaying translated text for 'hello' and 'welcome' */}
      <p>{translate("hello")}</p>
      <p>{translate("welcome")}</p>
    </div>
  );
};

export default App;
npm package: @kambeo/react-google-places-autocomplete
Description: Google places autocomplete input for ReactJS.
Latest version: 3.3.4

This is a private fork of Tintef's [react-google-places-autocomplete](https://github.com/Tintef/react-google-places-autocomplete). We moved TypeScript to be a peer dependency.

You can find us at: [Kambeo](https://kambeo.io)!