open-index/open-npm huggingface dataset:
npm package: @hoganb/semantic-release
Description: [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
Latest version: 6.0.0

# @hoganb/semantic-release
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

semantic-release automates the whole package release workflow including:
- Determining the next semantic version number based upon conventional commits
- Generating the release notes
- Publishing the package to public npm registry 

## Notes
Branch protection to push directly to `main` branch **disabled** in order for the *semantic-release* bot to update package version (in both `package-lock.json` and `package.json`) and `CHANGELOG.md` files on release.

## Q&A
Q. How does it determine the next version number and generate release notes?

- A. It uses formalized commit messages. e.g. fix: for patch version, feat: for minor version, and BREAKING_CHANGE: for the major version

Q. How does it publish the package?

- A. It internally run command of npm publish using npm token

### Footer

Add footer note
npm package: @hogashi/rot13
Description: rot13
Author: hogashi
Latest version: 1.0.2

# node-rot13

rot13 in node

## Usage

```javascript
import Rot13, { rotate } from '@hogashi/rot13';

// offset is 13 in default
const rot13 = new Rot13();
const c1 = rot13.encrypt('Golgo13'); // 'Tbytb13'
const d1 = rot13.decrypt(c1); // 'Golgo13'

// set offset
const rot7 = new Rot13(7);
const c2 = rot7.encrypt('Double-O-7'); // 'Kvbisl-V-7'
const d2 = rot7.decrypt(c2); // 'Double-O-7'

// or, rotate string simply
const c3 = rotate('large offset', 51); // 'kzqfd neerds'
const c4 = rotate('taken remainder with 26', -51); // 'ublfo sfnbjoefs xjui 26'
```
npm package: @hoge1e3/bottomup
Description: A bottom-up directory traversal utility that iterates files in order of recent updates. Compatible with @hoge1e3/sfile.
Author: hoge1e3
Latest version: 1.0.0

# @hoge1e3/bottomup

A bottom-up directory traversal utility that yields files ordered by their last update time. Designed to work with `@hoge1e3/sfile`'s `SFile` API.

## Features
- Traverses directories recursively
- Sorts files by recent modification (most recent first)
- Skips excluded files and folders based on pattern or function
- Optionally moves up to parent directories

## Installation
```bash
npm install @hoge1e3/bottomup
```

## Usage
```ts
import bottomup from "@hoge1e3/bottomup";
import { SFile } from "@hoge1e3/sfile";

const root = SFile.get("./some/dir");
for (const file of bottomup(root, {
  excludes: [/node_modules/, "dist"]
})) {
  console.log(file.path());
}
```

## API
### `bottomup(dir: SFile, opt?: DirectoryOptions): Generator<SFile>`
- `dir`: Root directory to start traversal
- `opt.excludes`: A string, regex, function, or array of these used to skip files/dirs

## License
MIT

## Author
[hoge1e3](https://github.com/hoge1e3)
npm package: @hoge1e3/counter
Description: Count-up elements.
Author: hoge1e3
Latest version: 1.0.2


# @hoge1e3/counter

Count-up elements 

## Example
~~~js
import {Counter} from "@hoge1e3/counter";
import * as assert from "assert";
const c=new Counter();
// c is a Counter that counts numbers 
for(let e of [1,2,2,8,2,2,6,3,1,2]){
    c.add(e);
}
assert.equal(c.get(2),5);// 2 is added 5 times.
assert.equal(c.get(1),2);// 1 is added 2 times.
assert.equal(c.get(6),1);// 6 is added once.
assert.equal(c.get(8),1);// 8 is added once.
assert.equal(c.get(42),0);// 42 is never added.
// show the numbers and its counts(frequencies) in desdending order of the count.
for(let [e,n] of c.descend()){
    console.log(e,n);// [2, 5], [1, 6] ...(42 is not appear here)
}
// in ascending order
for(let [e,n] of c.ascend()){
    console.log(e,n);
}
~~~

## class Counter&lt;E&gt;
- add(e:E, by?:number=1):number;
   - add element `e` and increments count by `by`, default is 1
- ascend():[E,number][];
   - returns elements and its counts in asdending order of the count.
- descend():[E,number][];
   - returns elements and its counts in desdending order of the count.
npm package: @hoge1e3/default-map
Description: Map with default value
Author: hoge1e3
Latest version: 1.0.7

# default-map

Map with default value

~~~js
import {DefaultMap} from "@hoge1e3/default-map";
import * as assert from "assert";
// Map with default value is 0
const m=new DefaultMap(0);
m.set("foo",5);
assert.equal(m.get("foo"),5);
// key 'bar' is missing. get("bar") returns the default value
assert.equal(m.get("bar"),0);

// The default value is set by function that receives the missing key.
const n=new DefaultMap((k)=>`Unknown '${k}'`);
n.set("foo","I know the foo.");
assert.equal(n.get("foo"),"I know the foo.");
// key 'bar' is missing. get("bar") generates default value and the value is associated to the key 'bar' 
assert.equal(n.get("bar"),"Unknown 'bar'");
// The value can be overriden;
n.set("bar","I also know the bar.");
assert.equal(n.get("bar"),"I also know the bar.");

// Default value with mutable object, setEmpty should be true
const o=new DefaultMap<string, string[]>(()=>[], true);
// o.get("cat") calls o.set("cat",[]) automatically.
const cats=o.get("cat");
cats.push("Persian");
cats.push("Bengal");
cats.push("Ragdoll");
const dogs=o.get("dog");
dogs.push("Bulldog");    
dogs.push("Chihuahua");    
// If setEmpty==false, the o.get("cat") will be empty array!
assert.deepStrictEqual(o.get("cat"), ["Persian","Bengal","Ragdoll"]);
assert.deepStrictEqual(o.get("dog"), ["Bulldog","Chihuahua"]);
// If setEmpty==false, o.has("cat") never true until o.set("cat",...) is called 
assert.ok(o.has("cat"));
assert.ok(o.has("dog")); 
assert.ok(!o.has("rabbit"));
~~~

# API

- DefaultMap<K,V> extends Map<K,V>
- new DefaultMap<K,V>(def:V|(key:K)=>V, setEmpty=false)
   - Create DefaultMap
      - `def` a default value or function that returns value for given key
      - `setEmpty` if set to true, when `get(key)` is called and the key is missing, the default value (given by `def`) is set to the key, otherwise, the default value is not set. 
      - `setEmpty` should be true if the associated value is a mutable object(such as array).
npm package: @hoge1e3/dom
Description: Create HTML Element with shorthand expression.
Author: hoge1e3
Latest version: 1.0.1

# @hoge1e3/dom
Create HTML Element with shorthand expression.

# API

`tagGenerator` creates TagGenerator
~~~
t=tagGenerator();
~~~
Call methods to the generated TagGenerator object in the following format.
~~~
t.tagName( attributes ,  subelements.... )
t.tagName( subelements.... )
~~~
`tagName` shoule be substituted to the tag name (ex `t.div` , `t.button` ). Any tag name can be accepted(uses proxy internally).

`attributes` is plain object. For the key that begins with 'on', function should be given as the value(automatically call addEventListener).

`subelements` shoule be either primitive values(for text node), or HTMLElement


returns HTMLElement

Example:
~~~~js
    t.div(
        {style:"color:blue;"},
        "hello",
        t.button({
            onclick(){
                alert(3);
            },
            style:"padding:10px;",
        },"go"))
~~~~
returns HTMLElement represented in HTML: 
~~~~html
    <div style="color:blue;">
        hello
        <button style="padding:10px">go</button>
    </div>
~~~~
and click event is bound to the button.

# type definitions

~~~typescript
export function tagGenerator():TagGenerator;
type TagGenerator={
    [key:string]:TagFunction,
};
type Attribute=object;
type SubElement=Node|string|number|boolean|null|undefined;
type TagFunction=
    ((...args:SubElement[])=>HTMLElement)|
    ((attr:Attribute, ...args:SubElement[])=>HTMLElement);
~~~
npm package: @hoge1e3/dom-bind
Description: Bind object to dom element
Author: hoge1e3
Latest version: 1.0.0

# @hoge1e3/dom-bind

A lightweight utility to bind plain JavaScript objects to DOM elements.

## Features

- Bind objects to DOM elements with ease
- Retrieve and remove bindings when needed
- Zero dependencies, simple API

## Installation

```bash
npm install @hoge1e3/dom-bind
```

## Usage

```js
import { bind, bounded, unbind } from '@hoge1e3/dom-bind';

const obj = { name: 'Alice' };
const element = document.querySelector('#myElement');

bind(element, obj); // Binds obj to the DOM element

const boundObj = bounded(element); // Retrieves the bound object

unbind(element); // Removes the binding
```

## API

### `bind(element: Node | string, object: object): object`
Binds an object to a DOM element. Accepts either a DOM node or a CSS selector.

### `bounded(element: Node | string): object`
Retrieves the object bound to the DOM element.

### `unbind(element: Node | string): void`
Removes the object binding from the DOM element.

## License
MIT
npm package: @hoge1e3/dom-mutable-events
Description: A utility for adding, removing, copying, and overwriting DOM event listeners with tracking capability.
Author: hoge1e3
Latest version: 1.0.0

# @hoge1e3/dom-mutable-events

`@hoge1e3/dom-mutable-events` is a utility class for managing DOM event listeners. It allows you to add, remove, copy, and overwrite event listeners while internally tracking them for precise manipulation.

## Features
- Track added event listeners using a `Symbol` property on the element
- Remove individual or all event listeners by type
- Copy event listeners between elements
- Overwrite existing listeners on an element with those from another element

## Installation
```bash
npm install @hoge1e3/dom-mutable-events
```

## Usage
```js
import EventManager from '@hoge1e3/dom-mutable-events';

const manager = new EventManager();
const button1 = document.getElementById('button1');
const button2 = document.getElementById('button2');

function onClick(e) {
  console.log('Clicked!', e);
}

manager.add(button1, 'click', onClick);
manager.copy(button2, button1);
// Now button2 also has the click event

manager.remove(button1, 'click', onClick);
```

## API
### `add(target, type, listener, options)`
Adds an event listener and tracks it internally.

### `remove(target, type?, listener?, options?)`
Removes specified or all listeners of a given type.

### `copy(toEl, fromEl, type?)`
Copies listeners from one element to another.

### `overwrite(toEl, fromEl, type?)`
Removes listeners from `toEl` and then copies from `fromEl`.

## License
MIT
npm package: @hoge1e3/events
Description: Add event handler by 'on' method to objects. 
Author: hoge1e3
Latest version: 1.0.1

# @hoge1e3/events

Add event handler by 'on' method to objects.

~~~~
import {EventHander} from "@hoge1e3/events";
import {equal} from "assert";
const buf=[];
const out=(s)=>{
    console.log(s);
    buf.push(s);
};
async function main() {
    // create EventHandler
    const e=new EventHandler();
    // set event handler for event "foo"
    e.on("foo", ()=>out("foo1"));
    // set event handler for event "foo" and get remover object 'r'
    const r=e.on("foo", ()=>out("foo2"));
    e.fire("foo");// fire "foo" event, outputs "foo1" and "foo2"
    r.remove(); // disable the event hander which outputs "foo2"
    e.fire("foo");// fire "foo" event, outputs only "foo1".
    equal(buf.join("\n"),["foo1","foo2","foo1"].join("\n"));

    // attach Event Handler to other object
    buf.length=0;
    const t=new Test();
    EventHandler.attachTo(t);// attach event handler to 't'
    // Now t.on and t.fire is available.
    const r2=t.on("bar", ({x})=>out("bar2 "+x*2));
    t.on("bar", ({x})=>out("bar3 "+x*3));
    t.bar(100);
    r2.remove();
    t.bar(200);

    equal(buf.join("\n"),["bar 100","bar2 200","bar3 300","bar 200","bar3 600"].join("\n"));

} 
class Test {
    bar(x) {
        out("bar "+x);
        this.fire("bar",{x});
    }
}
run();
~~~~
npm package: @hoge1e3/is-plain-object
Description: Check if an object is a plain JavaScript object by comparing prototype depth.
Author: hoge1e3
Latest version: 1.0.0

# is-plain-object

Check if an object is a plain JavaScript object by comparing its prototype depth.

## Installation

```bash
npm install is-plain-object
```

## Usage

```js
import isPlainObject from 'is-plain-object';

console.log(isPlainObject({})); // true
console.log(isPlainObject([])); // false
console.log(isPlainObject(Object.create(null))); // false
```

## API

### `isPlainObject(o)`

Returns `true` if the input `o` is a plain object (i.e., `{}`), based on a depth probe of its prototype chain.

## License

MIT
npm package: @hoge1e3/on-resume
Description: Event fires on current browser tab re-activated after deactivated.
Author: hoge1e3
Latest version: 1.0.0

# @hoge1e3/on-resume

Event fires on current browser tab re-activated after inactivated.

## Function

on("resume",handler)

- Calls handler when browser tab re-activated.
- Resumption is detected using `setInterval` and called every 20 milliseconds when active. If the actual call interval becomes longer (500 milliseconds or more), it is considered “inactive.” When it is called again at approximately 20-millisecond intervals, it is considered “resumed.”

## Usage

~~~js
#!run
import {on} from "@hoge1e3/on-resume";

export function main() {
    on("resume",()=>{
        alert("Resumed!");    
    });
}
~~~

## LICENSE

MIT
npm package: @hoge1e3/psync
Description: File synchronization
Author: @hoge1e3
Latest version: 1.0.1

# @hoge1e3/psync
File Synchronization with minimum conflict check, login-free.

# Preparation

- Put store.php in https://github.com/hoge1e3/sync to your Web Server. 
- Configure config/config.php
- Set Environment Variable STORE_URL as the URL of store.php

# Commands 

`npx psync init`
 - initialize current folder.  
 - `<branch-id>` is auto-generated
 - NOTE: Anyone who knows `<branch-id>` can synchronize(write) to this branch.

`npx psync branch`
 - Folder must be initialized by `init` or `clone` 
 - Shows `<branch-id>` of current folder. 

`npx psync clone <branch-id>`
 - Clones branch of `<branch-id>` into current folder.
 - Current folder must be empty.

`npx psync`
 - Folder must be initialized by `init` or `clone` 
 - Synchronizes current folder.
 - If there are conflicted files, they will saved in same folder with diferrent name.

`npx fork`
 - Folder must be initialized by `init` or `clone` 
 - Creates new branch. `<branch-id>` will be re-generated. Further synchronization uses the new branch.
npm package: @hoge1e3/rpc
Description: RPC with Proxy object
Author: hoge1e3
Latest version: 1.7.0

# rpc
Send to/from worker/iframe via postmessage.

## Sample Code
See `test/` folder.

## API Reference
- `new rpc.Server(channel:string, allowOrigin:string[])`
  - Create server in iframe or Worker context.
  - `serv(name:string, (params:any)=>any)`
    - set service with specified name and function.
- `new rpc.Server(target: Window|Worker, channel:string, allowOrigin:string[])`
  - Create "reverse" server in browser context to process request from target
  - use `serv` method as well
- `new rpc.Client(target: Window|Worker, channel:string, origin:string|undefined)`
  - Create client connect to target
  - `run(name, params:any)`
    - send request to service with name. 
    - Return value is a Promise of the result value processed in service.
- `rpc.proxy.server(channel:string, allowOrigin:string[], methods:{[key:string]:Function})`
  - Create proxy-styled server. 
  - `methods` are list of service that can call from client. 
- `rpc.proxy.server(target: Window|Worker, channel:string, allowOrigin:string[], methods:{[key:string]:Function})`
  - Create proxy-styled "reverse" server that receives request from target. 
- `rpc.proxy.client(target: Window|Worker, channel:string, origin:string|undefined)`
  - Create proxy-styled client.
  - This client can call service on server with regular method invocation style. 
- `rpc.proxy.transfer(o, trans?)`
  - Mark a transferable object to be transferred (not copied) when passed to a proxy-styled client call.
  - `o`: The object to transfer (e.g. `ArrayBuffer`, `MessagePort`).
  - `trans`: Optional explicit list of transferables. They should be highly related with `o`(ex. property of `o`). Defaults to `[o]`. `
  - Example: `proxyClient.myMethod(rpc.proxy.transfer(buffer))`

## Worker Utilities

`rpc.worker` provides shorthand helpers for Worker contexts, omitting origin-related arguments that are only needed for cross-origin iframe communication.

- `rpc.worker.server(channel:string)`
  - Create a server inside a Worker. Equivalent to `new rpc.Server(globalThis, channel, [])`.
- `rpc.worker.client(target:Worker, channel:string)`
  - Create a client that connects to a Worker. Equivalent to `new rpc.Client(target, channel)`.
- `rpc.worker.proxy.server(channel:string, methods:{[key:string]:Function})`
  - Create a proxy-styled server inside a Worker.
- `rpc.worker.proxy.client(target:Worker, channel:string, manualProbe?:boolean)`
  - Create a proxy-styled client that connects to a Worker.
- `rpc.worker.proxy.withChannel(channel:string)`
  - Returns a `{ server(methods), client(target, manualProbe?) }` factory with the channel name fixed.
  - Useful when the same channel is referenced in multiple places.
- `rpc.worker.proxy.defaultChannel`
  - A pre-built factory equivalent to `rpc.worker.proxy.withChannel("default")`.