open-index/open-npm huggingface dataset:
npm package: @repcomm/anbunny
Description: ![img](./icon.svg)
Author: Jonathan Crowder
Latest version: 1.0.2

# anbunny
![img](./icon.svg)

WebSocket/http based localhost announcer relay server.

## Purpose
I want to create an easy/extendable way to share basic info between
web pages/apps/extentions on the localhost machine only.

For instance, a browser extension to detect what music is being listened to
from yt,ytm,spotify,soundcloud, etc and sends it to the anbunny localhost
server, where it will be relayed to other processes that subscribe to that specific type of data.

## Main goals/features
- securely pass / subscribe to data on localhost
- reject non-localhost connections
- singleshot http post/get
- websocket pub/sub
- unique key based pub/sub

## usage
TODO

## Installation
You only need the ts definitions for intellisense.

```bash
npm i --save-dev @repcomm/anbunny
```
npm package: @repcomm/exponent-ts
Description: exponent-ts
Author: Jonathan Crowder
Latest version: 1.1.9


# exponent-ts

Fancy wrapper that make working with HTML less verbose and more automate-able.

0 dependencies - typescript, javascript

Tested / functional in webpack, and snowpack

## Example
```ts

```

## Exponents (premade components)
 - Grid - internally uses display:grid
 - Button - sets up css to make buttons flex properly
 - DualPanel - mount 2 elements w/ ratio, direction
 - ContextPanel - render single component from set, switch using string IDs
 - ImagePanel - adds functionality for fitting the image
 - Knob - rotation input with configurable turn and value bounds
 - OverlayPanel - render two components on top of each other in a panel
 - Panel - your basic container (think div, but with all the flex stuff)
 - SquarePanel (non-final) - the component mounted will always have ratio 1:1 dimensions
 - Drawing - canvas component w/ built in auto-resize, render loop, render passes, helper methods

## Planned Exponents
 - List
 - Paged List (for large lists)
 - Toggle Button
 - Number
 - Multi-select
 - Slider

## Planned features
 - Track object properties
 - Serialize to JSON
 - Visual drag'n'drop editor

## Visuals
![img](./example.png)
npm package: @repcomm/gameinput-ts
Description: gameinput-ts
Author: Jonathan Crowder
Latest version: 1.10.4


# gameinput-ts
Runtime re-mappable procedural input for the web

# current-support
- keyboard
- mouse
- touch
- gamepad
- importing JSON input mappings during runtime!

# future-support
- UI elements
- WebSocket API

# how it works
The main idea:
- Anything can be a button
- Anything can be an axis

Anything being:
- keyboard buttons
- mouse buttons
- mouse axes
- touch
- gamepad buttons
- gamepad axes
- HTML elements

## Classes
- Input (raw, hooks into browser APIs, used by GameInput)
- GameInput - main API
- Button - unique names, boolean state
- Axis - unique names, floating point state

## Using
### Installing
- Via NPM (usage with webpack or snowpack, which are tested)
<br>
```
npm install @repcomm/gameinput-ts
```
```ts
import { GameInput } from "@repcomm/gameinput-ts";
```
- Browser ESM script:
<br>
```js
<script type="module">
import { GameInput } from "/path/to/gameinput/mod.js";
</script>
```

### Example Usage
```js

//so we can use await
async function main () {
  
  //get the singleton
  let input = GameInput.get();
  
  //create an axis
  input.getOrCreateAxis ("forward")
  .addInfluence ({
    //value when triggered by boolean state (such as keys, mouse buttons, gamepad buttons)
    value: 1.0,
    
    //make it influenced by first mouse button
    mouseButtons:[0],
    
    //you can also make it take on the value of the mouse axes
    mouseAxes:[0],
    //scale factor when activated by mouse/touch
    pointerAxisScale: 0.5,
    
    //use gamepad axes!
    gpAxes:[0],
    //scale factor when activated by gamepad axes
    gpAxisScale: 2,
    //force use of specific connected gamepad
    gpIndex: 0
  });
  
  //You can also supply JSON!
  const inputMapFile = "./demo.input.json";
  console.log(`Fetching ${inputMapFile}`);
  let config = await (await fetch( inputMapFile )).json();

  //button and axis definitions will merge with pre-existing buttons and axes
  input.addJsonConfig( config );
  
  //loop
  let fps = 30;
  setInterval (()=>{
    //get the axis value
    let fwd = input.getAxisValue ("forward");
    
    console.log(fwd);
    
  }, 1000/fps);

}

main();


```

## Compiling
To build you'll want to clone the repo<br>
`git clone https://github.com/RepComm/gameinput-ts.git`

## Install dev dependencies
`npm install`
## Build
`npm run build`
npm package: @repcomm/kissbb
Description: 2d AABB
Author: Jonathan Crowder
Latest version: 1.1.1

# kissbb
Keep it simple stupid 2d AABB

Utilizing `@repcomm/vec2` npm package

## Using
To install with npm run<br>`npm install @repcomm/kissbb`<br><br>
This package comes with typescript definitions, and should work in both typescript and javascript.

## Example Usage
TODO

## Compiling
TS -> JS is done using babel.js<br>
You can check out [ts-esm-babel-template](https://github.com/RepComm/ts-esm-babel-template)<br>
Which shows esmodule + typescript w/ babel -> js output<br><br>

or [webpack-ts-template](https://github.com/RepComm/webpack-ts-template) <br>
Which shows esmodule + typescript w/ babel + npm package integration<br>
<br>

To build you'll want to clone the repo<br>
`git clone https://github.com/RepComm/vec2d.git`

Run `npm install` to get dependencies

Run `build.sh` (note: runs `npm run build`)
for compiling to javascript

----

For compiling ts defs you'll need [typescript](https://www.npmjs.com/package/typescript)<br>
Run `npm install -g typescript`

Run `build-types.sh`
npm package: @repcomm/mt-3d-armor-api
Description: minetest typescript definitions for 3d-armor mod
Author: Jon Crowder
Latest version: 1.0.1

# mt-3d-armor-api
Type definitions for using 3d-armor mod api for minetest

## dev-dependencies
- [mt-api](https://github.com/RepComm/mt-api)
- [ts-to-lua](https://github.com/TypeScriptToLua/TypeScriptToLua)
- [lua-types](https://github.com/TypeScriptToLua/lua-types)

## contributors (any contributions welcome, thank you!)
- [repcomm](https://github.com/RepComm)

## also see
- [mt-visible-wielditem-api](https://github.com/RepComm/mt-visible-wielditem-api)
- [mt-api](https://github.com/RepComm/mt-api)
npm package: @repcomm/mt-api
Description: minetest typescript definitions
Author: Jon Crowder
Latest version: 1.0.12

# mt-api
Type definitions for using the minetest API

## using
Install dev dependency in your typescript project:
```
npm i @repcomm/mt-api --save-dev
```

And use:
```
import type {} from "@repcomm/mt-api";
```

The module declares the minetest global the same way you'd use it in lua<br/>
you can also utilize the types it provides in your own code by importing them:

```
import type { MtVec3 } from "@repcomm/mt-api";

let myVec: MtVec3 = { x: 0, y: 0, z: 0 };
```

## implemented
- minetest global namespace
```ts
minetest.register_on_joinplayer( (player)=>{
  let playername = player:get_player_name();

  minetest.chat_send_player(playername, "Welcome!")
} );
```

## dev-dependencies
- [ts-to-lua](https://github.com/TypeScriptToLua/TypeScriptToLua)
- [lua-types](https://github.com/TypeScriptToLua/lua-types)

## contributors (any contributions welcome, thank you!)
- [repcomm](https://github.com/RepComm)

## also see
- [mt-visible-wielditem-api](https://github.com/RepComm/mt-visible-wielditem-api)
- [mt-3d-armor-api](https://github.com/RepComm/mt-3d-armor-api)

## contributing
Users of minetest's lua api will noticed a lack of `":"` in typescript

Lua uses `obj:method` and `obj.func` to differentiate with `obj` is passed as `self` as the first argument

For instance:
```lua
local obj = {
  method = function (self)
    --"self" refers to obj, similar to "this" in typescript
  end

  func = function ()
    --no self variable here
  end
};

obj.method() -- self will be nil
obj:method() -- self will be obj

obj.func() -- self will be nil
obj:func() -- self will still be nil because its not declared in function args
```

In typescript this is handled by providing a `this` definition:
```ts
interface MinetestGlobal {
  register_on_joinplayer (this: void, cb: MtPlayerJoinCallback): void;
}
declare global minetest: MinetestGlobal;
```

Because
```ts
this: void
```
TypeScript calls to `minetest.register_on_joinplayer()` will properly output:
`minetest.register_on_joinplayer()` in lua

Without providing `this: void`, this would generate:
`minetest:register_on_joinplayer()` as typescript-to-lua compiler assumes we want to provide a `self` reference as first argument

On the flip-side:
```lua
function handle_player_join (player) --player is ObjRef
  player:get_player_name() -- passes player as first arg to get_player_name code
end

minetest.register_on_joinplayer ( handle_player_join )
```

In typescript definitions:
```ts
interface ObjRef {
  //implicit this: ObjRef
  get_player_name(): string;
  //same as
  get_player_name(this: ObjRef): string;
}
```
Which both properly output:

```lua
player:get_player_name()
```
npm package: @repcomm/mt-visible-wielditem-api
Description: minetest visible-wield-item mod typescript definitions
Author: Jon Crowder
Latest version: 1.0.1

# mt-visible-wielditem-api
Type definitions for using the visible-wielditem mod with @repcomm/mt-api

## dev-dependencies
- [mt-api](https://github.com/RepComm/mt-api)
- [ts-to-lua](https://github.com/TypeScriptToLua/TypeScriptToLua)
- [lua-types](https://github.com/TypeScriptToLua/lua-types)

## contributors (any contributions welcome, thank you!)
- [repcomm](https://github.com/RepComm)

## also see
- [mt-api](https://github.com/RepComm/mt-api)
- [mt-3d-armor-api](https://github.com/RepComm/mt-3d-armor-api)
npm package: @repcomm/openbf-ts
Description: OpenBF
Author: RepComm
Latest version: 1.0.1

# OpenBF - client / API

This package acts as the game client source,<br>
as well as the NPM package dev-dependency<br>
for creating mods for the game.

## Running openbf-client
### For players
Distribution is not ready as of yet
Instructions won't work until then

#### Installation
Step is not implemented yet

#### Running
Start the game by running
```bash
./openbf.sh
```
Browser should open automatically<br>
If it does not, try pasting `localhost:8080` in your browser of choice

### Developers
0. Pre-requisites:
- [nodejs & npm](https://nodejs.org)
- [deno](https://deno.land)

1. Install npm packages<br/>
```bash
npm install
```

2. Build using webpack/babel<br/>
```bash
./build.sh
```

3. Run the deno local content server
```bash
cd ./apphost

./start.sh
```

4. Connect your browser<br/>
URL should log in console<br/>
But by default its 
```
http://localhost:8080
```

### Building the API
This is really only useful to the project author, since there should only ever be one API.

If you want to add standard features, you have two options:
- pull request (yeah, i know)
- implement it in your own mod (see [using mod imports](#using-mod-imports))

You'll need to have [tsc command](https://www.npmjs.com/package/typescript)<br>
Then run
```bash
build-types.sh
```

The API is published to npm with
```bash
publish.sh
```

# using-mod-imports
Importing code that is exported from another mod can be done by:
```js
import { things, etc } from "@modname:/some/script.js";
```

There is no intellisense (and usually errors) in your editor, but I plan on remedying this
npm package: @repcomm/pubmarine
Description: ephemeral pub sub networking for node/web
Author: Jon Crowder
Latest version: 0.1.0

# pubmarine
pub/sub over websockets

### WARNING: NOT PRODUCTION READY - RUN AT OWN RISK

At one point I wanted to create a big fancy realtime decentralized database, but now I realize the scope is too big.

I really need a pubish/subscribe data networking lib for the browser/node, so this is it.

## usage
### web
See [test.ts](./src/test.ts) and [test.html](./dst/test.html)

```ts
  import { Client } from "@repcomm/pubmarine";

  //create a client that should connect to a server
  const client = new Client(window.location.host);

  //wait for connection
  await client.connect();

  //you can impl your own auth model (or none)
  const auth = { apiKey: "blah" };
  //wait for authentication
  await client.authenticate(auth);

  //check if player schema exists yet
  if(!await client.hasSchema("players")) {

    //if it doesn't, try to create it
    await client.createSchema("players", {
      type: "dict",
      children: {
        "x": { type: "number" },
        "y": { type: "number" },
        "name": { type: "string" }
      }
    });
  }

  await client.subscribe("players",(instanceId, updateData, isNewInstance)=>{
    //fired for instantiations and mutations of all players
  });
  
  //create an instance of player on the server
  const localId = (await client.instance("players")).response.id;
  
  //subscribe to mutations on only it
  await client.subscribe({
      topic: "players",
      id: localId
    }, ( id, updateData, isNewInstance)=>{

    //fired for mutations of our own player instance
  });

  //publish a change to our player data
  //any chance you make is pushed to subscribers
  await client.mutate("players", localId, {
    name: prompt("Enter player name", "testbot"),
    x: 0.5,
    y: 0.5
  });
```

## authentication
No security so far, this is one of the last TODOs for MVP

```ts
// TS/JS client side
async client.authenticate( a: ClientAuthReq )
```

`auth.js` is responsible for authenticating a client
```ts
import type { MsgReq } from "./common";

//server side
export async function auth (msg: MsgReq<ClientAuthReq>): Promise<string> {

  //generate a random int as the client's ID
  return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString();
}
```

`auth.js` is monitored for changes and will be reloaded when ./dst/auth.js is mutated on the disk.

In the future, I will add a basic pocketbase authentication example.

`ClientAuthReq` can be an object of any shape, the only places it is used are in the above files.

Essentially to add in your own auth model simply change `auth.js` (auth.ts in the source of this repo compiles to it), and pass the correct shape to `client.authenticate( v )`
npm package: @repcomm/scenario2d
Description: minimal 2d scene graph library for web canvas
Author: Jonathan Crowder
Latest version: 2.0.3

# scenario2d
Zero dependencies 2d scene graph for web canvas

## Implemented Classes
- Resource, TextResource, XmlResource, SvgResource

- Object2d (base class for scene objs)
- PathObject2d - svg `d` attribute equivalent
- Transform2d - scale, translate, rotation
- Vec2

## Using
To install with npm run<br>`npm install @repcomm/scenario2d`<br><br>
This package comes with typescript definitions, and should work in both typescript and javascript.

## Example Usage
See [index.html](./index.html) and [index.js](./index.js) <br/>

Note: Example uses my other library [exponent-ts](https://github.com/RepComm/exponent-ts)<br/>

As well as [es-module-shims.js](https://github.com/guybedford/es-module-shims) to load node_modules using import maps directly in the browser.

This is to reduce build time to < 1s<br/>

hence the extra boilerplate in index.html

## Compiling

To build you'll want to clone the repo<br>
`git clone https://github.com/RepComm/scenario2d.git`

Run `npm install` to get dependencies

Run `npm run build`
npm package: @repcomm/snowpack-ts-template
Description: A template for using snowpack and typescript
Author: Jonathan Crowder
Latest version: 1.0.2


# snowpack-ts-template

My personal template for using:
- TypeScript
- ES modules
- npm packages
- d.ts files
- publishing to npm

All accomplished with [snowpack](https://www.snowpack.dev/)!

## scripts
### start
Local http dev server (uses `snowpack dev`)
`npm run start`
### build
`npm run build`
### build-types
`npm run build-types`
### publish
`npm run publish`
npm package: @repcomm/sserve
Description: serve, but with SSL and file streams
Author: Jonathan Crowder
Latest version: 1.0.0

# sserve
Like `serve`, but supports HTTPS, and streams files instead of reading into RAM

## why
I wanted to transfer a 22GB + file from fedora workstation to Ventura Mac,
it went quicker to write a script to pipe a file stream to http server than to transfer via usb..

Serve is great, but it choked on the 22GB file, but OSes apparently block the UI thread while doing almost zero network load while waiting for the file to load.
I don't know what the plan was, but I don't have 22GB of ram, and I disable swap.

Also the need for using self signed SSL certs comes up a lot.

## usage
`npm i @repcomm/sserve -g`

Navigate to directory wished to be served, then run:

`$ sserve`

## implemented
- directory navigation (including spaces in file names)
- file streaming (doesn't choke on large files)
- basic interface
- half baked server side renderer w/ similar API to @roguecircuitry/htmless

## not implemented / planned mvp
- proper sanitisation (god knows what people will name their files)
- SSL is not tested yet
- auto-gen self signed SSL keys w/ openssh
- download folder as zip feature

## non-mvp ideas
- upload files?
npm package: @repcomm/three.lookcamera
Description: bare bones LookCamera and FreeCamera for three.js, js or ts
Author: Jonathan Crowder
Latest version: 1.0.4

# three.lookcamera
A look camera and freecamera for your three.js projects

Depends only on three.js

Comes with d.ts typescript definitions

Doesn't force you to use any weird input system

[Shameless plug if you need a procedural input lib](https://github.com/RepComm/gameinput-ts)

## Example

`npm install @repcomm/three.lookcamera`

```typescript
import { FreeCamera } from "@repcomm/three.lookcamera";

const freecam = new FreeCamera ();

scene.add( freecam );

// freecam.getCamera(); // for when you want to render with it

//game input loop

//move the camera, typically with WASD/arrow keys
freecam.addMovementInput( forwardDelta , sideDelta );

//rotate the camera, typically with the mouse
freecam.addRotationInput ( horizontalDelta, verticalDelta );

```