open-index/open-npm huggingface dataset:
npm package: @fry/base62
Description: Base62 encoder/decoder
Author: Fredric Rylander
Latest version: 1.1.0

# base62

<a href="https://en.wikipedia.org/wiki/Base62" target="_blank">Base62</a> encoder/decoder

## Installation

`npm install --save @fry/base62`

## Usage

`encode()` expects data that can be turned into a `Buffer` (e.g. a `string`,
an `Array`, `ArrayBuffer`, or a `Buffer`) and it returns the Base62 encoded 
string.

`decode()` returns the decoded data in a `Buffer` which has good readers for
binary data as well as a fast `toString()` that can return the data encoded 
in `utf8` (default), `base64`, `hex`, etc.

### Binary input

```javascript
    const base62 = require('@fry/base62');

    const encoded = base62.encode([0x2a, 0x2a]);
    // encoded => AYA

    const decoded = base62.decode(encoded);
    // decoded => <Buffer 2a 2a>

    decoded[0]; // => 0x2a
    decoded.readUInt16BE(); // => 0x2a2a
```

### String input

```javascript
    const encoded = base62.encode('Memento vivere');
    // encoded => JMLjPMvqRo1sQNPbSc5

    const decoded = base62.decode(encoded);
    // decoded => <Buffer 4d 65 6d 65 6e 74 6f 20 76 69 76 65 72 65>

    decoded.toString(); // => Memento vivere
```

### Custom symbol table

There is no standard for Base62 encoding so various encoders may use different
symbol tables. This module will by default use alphanumerical characters in 
their natural order: `0-9A-Za-z`.

To use another set of characters first initiate them with `prepareSymbolTable()`
and then supply the resulting object as a second parameter to the encode/decode
functions, e.g.:

```javascript
    const symbols = base62.prepareSymbolTable('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789');
    const encoded = base62.encode([0x53, 0xfe, 0x92], symbols);
    // encoded => U98kC

    const decoded = base62.decode(encoded, symbols);
    // decoded => <Buffer 53 fe 92>
```

## Base62 encoding process

The Base62 symbol table is limited to 62 characters, which is just shy of 6 bits
of information. This means that special care needs to be taken in order to encode
any given stream of bytes. This module takes the approach of reading a sextet 
(6-bit chunk) from the binary stream and encode it into the symbol table as long
as the chunk is not in risk of overflowing. If the sextet is in the ”overflow 
zone“ then only 5 bits are used while encoding that particular chunk, indicated 
in the output by the presence of one of the symbol table’s last two characters. 
The overflow bit is left in the stream until the next sextet will be read. The 
last chunk may also be left-padded with zeroes during the encoding process which
the decoder will detect and reverse to ensure byte-alignment of the underlying 
binary stream.

Happy encoding!

/ Fry
npm package: @fry/bits
Description: Simplifies reading and writing bits in Buffers
Author: Fredric Rylander
Latest version: 1.0.2

# bits – Bits <3 Buffers

A tool for twiddling bits in buffers

## Installation

`npm install --save @fry/bits`

## Usage

Create a 0-filled bit-buffer with a length of any given bit-length

```javascript
const { Bits } = require('bits');
const bits = new Bits(15 * 8); // 15 bytes capacity
```

Or reference an already exisiting `Buffer`

```javascript
const buffer = Buffer.from([0xff, 0x00, 0xff, 0x00]);
const bits = new Bits(buffer);
```

There are also convenience functions to create prefilled buffers (note that these use byte-length arguments)

```javascript
const bits = Bits.alloc(6, 0xaa); // 6 * 8 bits capacity, with 0b10101010... repeated for all bits
```

```javascript
const bits = Bits.from('Yml0YnVm', 'base64'); // 48 bits capacity prefilled with data
```

After instantiating the bit-buffer you can begin manipulating the bits

```javascript
const bits = new Bits(2 * 8);

// Write some bits, jump to the beginning of the buffer and read all bits
const value = bits
    .write(7, 3)
    .write(0x55, 7)
    .write(0b10, 2)
    .seek(0)
    .read(12); // value = 0b111101010110

// Turn on bit 4 and 5
bits.insert(0b11, 2, 4);

// Read the same 2 bits, not moving the offset
bits.peek(2, 4); // 0b11

// Get bit 4
bits.getBit(4); // 0b1

// Set bit 5 to 1
bits.setBit(5);

// Test if bit 5 is 1
bits.testBit(5); // true

// Clear bit 5 and flip bit 6
bits
    .clearBit(5)
    .flipBit(6);

// Stringify the buffer (e.g. ascii, utf8, ucs2, base64, binary, hex)
bits.toString('hex'); // 'fb60'
```
npm package: @frycz/info
Description: Ask questions in natural language and get concise, formatted responses directly in your terminal.
Latest version: 1.0.1

# info

Ask questions in natural language and get concise, formatted responses directly in your terminal.

`info` comes in handy when you want a quick lookup without changing the context. No need to run AI cli or switching to an UI-based tool. Just type `info git log print nicely` and you get `git log --oneline --graph --decorate`.

## Installation

```bash
npm install -g @frycz/info
```

## Prerequisites

You need at least one of the supported AI CLI tools installed:

- [Claude CLI](https://github.com/anthropics/claude-code) (default)
- [Gemini CLI](https://github.com/google-gemini/gemini-cli)
- [Ollama](https://ollama.ai/)
- [ShellGPT](https://github.com/TheR1D/shell_gpt)

## Usage

```bash
info <question>
```

Simply type your question after `info`. All arguments are joined into a single query.

### Examples

```bash
info number of countries in the world
# 193

info capital of australia
# canberra

info mass of the sun in kg
# 1.989e30

info git log print nicely
# git log --oneline --graph --decorate
```

### Options

```
info -h, --help     Show help
info -v, --version  Show version
```

## Configuration

Configure via environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| `INFO_AI_TOOL` | AI tool to use (`claude`, `gemini`, `ollama`, `sgpt`) | `claude` |
| `INFO_OLLAMA_MODEL` | Model to use with Ollama | `llama3.2` |

### Examples

```bash
# Use Gemini instead of Claude
export INFO_AI_TOOL=gemini

# Use Ollama with a specific model
export INFO_AI_TOOL=ollama
export INFO_OLLAMA_MODEL=mistral
```

## How It Works

The tool sends your question to an AI with a specialized system prompt that instructs it to:

- Respond with the shortest possible answer
- Use lowercase text only
- Return numbers without units (unless requested)
- Assume the most probable context for vague questions
- Return `ERR: <reason>` for unanswerable questions

## License

MIT
npm package: @fryinggorilla/mineflayer-web-inventory
Description: Web based viewer for your mineflayer bot's inventory
Author: imharvol
Latest version: 1.9.0

# Mineflayer Web Inventory
A simple web-based inventory viewer for [mineflayer](https://github.com/PrismarineJS/mineflayer) with support for **multiple types of windows and updated in real-time**.

## Install
`npm install mineflayer-web-inventory`

[![npm version](https://badge.fury.io/js/mineflayer-web-inventory.svg)](https://badge.fury.io/js/mineflayer-web-inventory)

Minimum recommended mineflayer version: 4.2.0 
Note that from version 1.3.0 mineflayer-web-inventory will only support mineflayer 3.X.X and 4.X.X versions
If you still wish to use mineflayer-web-inventory with mineflayer 2.X.X you can install mineflayer-web-inventory@1.2.1: `npm i mineflayer-web-inventory@1.2.1`

## Usage
- Run `npm install mineflayer-web-inventory`.
- Import mineflayer-web-inventory: `const inventoryViewer = require('mineflayer-web-inventory')`.
- Call inventoryViewer with your bot instance: `inventoryViewer(bot)`.

```js
const mineflayer = require('mineflayer')
const inventoryViewer = require('mineflayer-web-inventory')

const bot = mineflayer.createBot({
  host: 'localhost',
  port: 25565,
  username: 'bot',
  version: '1.18.2' // Its important to set this to the server's minecraft version. Otherwise it might not load data/textures correctly
})

inventoryViewer(bot)
```

This will start a web server in http://localhost:3000/.
You can change the options using:
```js
  let options = {
    port: PORT,
    webPath: PATH,
    express: EXPRESS,
    app: APP,
    http: HTTP,
    io: IO,
    startOnLoad: BOOLEAN,
    windowUpdateDebounceTime: INT
  }

  inventoryViewer(bot, options)
```
You can access the options in bot.webInventory.options

#### bot.webInventory.start()
Starts the web server. This function is called when the plugin is first loaded unless `options.startOnLoad` is `false`. Returns a `Promise` that resolves once the HTTP server is open.

#### bot.webInventory.stop()
Stops the web server. Returns a `Promise` that resolves once the HTTP server is closed.

You can also check the current status of the web server using `bot.webInventory.isRunning` which returns a boolean

## Screenshots
![Example Screenshot 1](https://user-images.githubusercontent.com/17525823/128013976-493448e3-aa22-43bc-8fb9-428f1ccf9b5f.png)
![Example Screenshot 2](https://user-images.githubusercontent.com/17525823/128013983-31f50c2f-e453-401b-a697-d21682e0c980.png)

https://user-images.githubusercontent.com/17525823/128014178-6ea85f97-6698-43dc-9b1f-81a1802885d4.mp4

### Images
The images used in this project are from https://wiki.vg/Inventory and https://github.com/PrismarineJS/minecraft-assets
npm package: @frysztak/openapi-generator
Description: Node.js wrapper for OpenAPI generator written in Haskell
Author: Sebastian Frysztak
Latest version: 0.1.2

# Node.js OpenAPI Generator wrapper

Node.js wrapper for [OpenAPI Generator](https://github.com/frysztak/openapi-generator).

## Install

```sh
$ yarn add -D @frysztak/openapi-generator
```

or

```sh
$ npm install --save-dev @frysztak/openapi-generator
```

## Usage

Create `.openapi-generator.json` in your project root. Sample file:

```json
{
  "generatorVersion": "0.1.0",
  "inputFiles": ["src/api/Admin.json", "src/api/User.json"],
  "outputDirectory": "src/api/clients"
}
```

Add the following to your `scripts` section in `package.json`:

```json
"scripts": {
  "gen-api": "run-openapi-generator generate"
}
```

## Supported subcommands

- `generate` - generates clients. Args:
  - `--config` (`-c`) -- path to `.openapi-generator.json` config file. Optional, defaults to `cwd`.
npm package: @frzr/collection
Description: frzr Collection
Author: Juha Lindstedt
Latest version: 0.1.6

# collection
[FRZR](http://github.com/frzrjs/frzr) Collection inspired by Backbone.js

## installation
```javascript
// with frzr
npm install frzr

// standalone
npm install @frzr/collection
```

## require
```javascript
// with frzr
var Collection = require('frzr').Collection

// standalone
var Collection = require('@frzr/collection')
```

## usage
```javascript
var collection = new Collection(options)
```

## options

- idAttribute: attribute to use as id
- index: attributes to index
- add: triggers when Model is added
- change: triggers when Model is changed
- remove: triggers when Model is removed
- move: triggers when Model is reordered
- model: custom extended model

Any other parameter will be added as a local attribute

### Example
```javascript
var options = {idAttribute: 'a'}
var CustomModel = Model.extend(options)

var items = [{a: 1, b: 2}, {a: 2, b: 3}]
var options = {
  idAttribute: 'a',
  index: 'b',
  add: add,
  change: change,
  remove: remove,
  model: CustomModel
}

var collection = new Model(options)
collection.reset(items)

function add (model) {
  console.log('added', model)
}
function change (model) {
  console.log('changed', model)
}
function remove (model) {
  console.log('removed', model)
}
collection.reset([{
  a: 2,
  b: 3,
  c: 4
}, {
  a: 3,
  b: 4
}])

// or
var CustomCollection = Collection.extend(settings)
var collection = new CustomCollection(data)
```

## methods

- get(id): get model by id
- set(items): set models
- reset(items): reset models (remove if necessary)
- unset(id): remove model by id

## events

- add: triggered when Model is added
- change: triggered when Model is changed
- move: triggered when Model is reordered
- remove: triggered when Model is removed
npm package: @frzr/inherit
Description: simple class inheritance
Author: Juha Lindstedt
Latest version: 0.0.1

# inherit
simple class inheritance

## install

    npm install @frzr/inherit
  
## example
    var inherit = require('@frzr/inherit')
    
    function Model () {
      console.log('constructor works')
      Model.super.call(this)
    }
    
    function SuperModel () {
      console.log('super call works')
    }
    
    inherit(Model, SuperModel)
    
    Model.prototype.proto = function () {
      console.log('proto works')
    }
    SuperModel.prototype.superproto = function () {
      console.log('inherited proto works')
    }
    
    var model = new Model()
    
    model.proto()
    model.superproto()
    
    console.log('is SuperModel:' + (model instanceof SuperModel))
npm package: @frzr/list
Description: Simple List for frzr
Author: Juha Lindstedt
Latest version: 0.0.7

# list
[FRZR](http://github.com/frzrjs/frzr) ordered list of Models

## installation
```javascript
// with frzr
npm install frzr

// standalone
npm install @frzr/list
```

## require
```javascript
// with frzr
var List = require('frzr').List

// standalone
var List = require('@frzr/list')
```

## usage
```javascript
var list = new List(options)
```

## options

- add: triggers when Model is added
- sort: triggers when Model is changed
- remove: triggers when Model is removed

Any other parameter will be added as a local attribute

### Example
```javascript
var items = [{_id: 1, groupA: 1, name: 'Item 1'}, {_id: 2, groupA: 1, groupB: 2, name: 'Item 2'}, {_id: 3, groupB: 2, name: 'Item 3'}]

var CustomModel = Model.extend({
  idAttribute: '_id'
})

var collection = new Collection({
  model: CustomModel,
  idAttribute: '_id'
})
collection.reset(items)

var options = {add: add, sort: sort, remove: remove} 
var list = new List(options)

list.reset(collection.find('groupA', 1))
list.reset(collection.find('groupB', 2))

function add (id, item, pos) {
  console.log('add:' + id, item, 'to', pos)
}
function sort (id, item, pos, oldPos) {
  console.log('sort:' + id, item, 'from', oldPos, 'to', pos)
}
function remove (id, item, pos) {
  console.log('remove:' + id, item, 'at' + pos)
}

// or
var CustomList = List.extend(settings)
var list = new CustomList(data)
```

## methods

- reset(models): update Models (add, sort and remove when necessary)

## events

- add: triggered when Model is added
- sort: triggered when Model is reordered
- remove: triggered when Model is removed
npm package: @frzr/view
Description: frzr View
Author: Juha Lindstedt
Latest version: 0.0.4

# view
[FRZR](http://github.com/frzrjs/frzr) View

## installation
```javascript
// with frzr
npm install frzr

// standalone
npm install @frzr/view
```

## require
```javascript
// with frzr
var View = require('frzr').View

// standalone
var View = require('@frzr/view')
```

## usage
```javascript
var view = new View(options)
```

## options

- init: triggers when View is created
- template: HTML string to build the template from. Gets parsed and memoized.

Any other parameter will be added as a local attribute

## methods

- $find(query): finds DOM elements inside template
  - You can use ```$find('$id')``` to find ```<div frzr="id"></div>``` superfast.
- mount(target): mount to DOM (rest is automatic)
- mountBefore(target, before): mount to DOM (with insertBefore)
- addListener(target, eventName, cb): shortcut to addEventListener but listeners get removed when view is destroyed
  - You can also use ```view.addListener('#id', 'click', onClick)``` as a shortcut for ```view.addListener(view.$find('#id'), 'click', onClick)```

## events

- add: triggered when View is added
- remove: triggered when View is removed
npm package: @frzr/viewcollection
Description: frzr Viewcollection
Author: Juha Lindstedt
Latest version: 0.0.11

# viewcollection
[FRZR](http://github.com/frzrjs/frzr) ViewCollection

## installation
```javascript
// with frzr
npm install frzr

// standalone
npm install @frzr/viewcollection
```

## require
```javascript
// with frzr
var ViewCollection = require('frzr').ViewCollection

// standalone
var ViewCollection = require('@frzr/viewcollection')
```

## usage
```javascript
var viewcollection = new ViewCollection(options)
```

## options

- add: triggers when View is added
- remove: triggers when View is removed
  
Any other parameter will be added as a local attribute

### Example
[Try live on JSFiddle](http://jsfiddle.net/25dusedw/1/)
```javascript
// have some data
var items = [{_id: 1, name: 'Item 1'}, {_id: 2, name: 'Item 2'}]

// create Model
var Model = frzr.Model.extend({
  idAttribute: '_id'
})

// create Collection
var collection = new frzr.Collection({
  idAttribute: '_id',
  model: Model
})  
collection.reset(items)

// define View
var View = frzr.View.extend({
  init: function () {
    this.render()
    this.model.on('change', this.render, this)
  },
  render: function () {
    this.$el.textContent = this.model.get('name')
  },
  template: '<p></p>'
})

// create ViewCollection
var viewCollection = new frzr.ViewCollection({view: View})
viewCollection.reset(collection.models)
viewCollection.mount(document.body)

setTimeout(function () {
    // change data
    items = [{_id: 2, name: 'Item 2'}, {_id: 3, name: 'Item 3'}]

    // trigger update
    collection.reset(items)
    viewCollection.reset(collection.models)
}, 1000)
```

## methods

- reset(models): resets Views based on models (adds/removes when necessary)
- mount(target): mount to DOM (rest is automatic)

## events

- add: triggered when View is added
- remove: triggered when View is removed
npm package: @frzr/viewlist
Description: View List for frzr
Author: Juha Lindstedt
Latest version: 0.0.3

# viewlist
[FRZR](http://github.com/frzrjs/frzr) ordered [List](http://github.com/frzrjs/list) of Views

## installation
```javascript
// with frzr
npm install frzr

// standalone
npm install @frzr/viewlist
```

## require
```javascript
// with frzr
var ViewList = require('frzr').ViewList // or frzr.ListView (in case of typo :)

// standalone
var ViewList = require('@frzr/viewlist')
```

## usage
```javascript
var viewlist = new ViewList(options)
```

## options

- view: custom extended View
- add: triggers when View is added
- sort: triggers when View is reordered
- remove: triggers when View is removed
  
Any other parameter will be added as a local attribute

### Example
```javascript
// have some data
var items = [{_id: 1, groupA: 1, name: 'Item 1'}, {_id: 2, groupA: 1, groupB: 2, name: 'Item 2'}, {_id: 3, groupB: 2, name: 'Item 3'}]

// define Model
var CustomModel = frzr.Model.extend({
  idAttribute: '_id'
})

// create Collection
var collection = new frzr.Collection({
  idAttribute: '_id',
  model: CustomModel
})  
collection.reset(items)

// define View
var CustomView = frzr.View.extend({
  init: function () {
    this.render()
    this.model.on('change', this.render, this)
  },
  render: function () {
    this.$el.textContent = this.model.get('name')
  },
  template: '<p></p>'
})

// create ViewList
var viewList = new frzr.ViewList({add: add, sort: sort, remove: remove, view: CustomView})
viewList.reset(collection.find('groupA', 1))
viewList.mount(document.body)

setTimeout(function () {
    // trigger update
    viewList.reset(collection.find('groupB', 2))
}, 1000)

function add (id, view, pos) {
  console.log('add:' + id, view, 'to', pos)
}
function sort (id, view, pos, oldPos) {
  console.log('sort:' + id, view, 'from', oldPos, 'to', pos)
}
function remove (id, view, pos) {
  console.log('remove:' + id, view, 'from', pos)
}
```

## methods

- reset(models): resets Views based on models (adds/removes when necessary)
- mount(target): mount to DOM (rest is automatic)
- unmount(): unmount from DOM

## events

- add: triggered when View is added
- sort: triggered when View is reordered
- remove: triggered when View is removed