open-index/open-npm huggingface dataset:
npm package: @jrc03c/base-css
Description: This is a little CSS library. I hope to build other libraries on top of it someday.
Latest version: 0.0.3

# Intro

This is a little CSS library. I hope to build other libraries on top of it someday.

[[screenshot](screenshot.png)]

# Installation

```bash
npm install --save @jrc03c/base-css
```

# Usage

```html
<!-- normalized -->
<link
  href="node_modules/@jrc03c/base-css/dist/base.norm.min.css"
  rel="stylesheet"
  type="text/css">

<!-- non-normalized -->
<link
  href="node_modules/@jrc03c/base-css/dist/base.min.css"
  rel="stylesheet"
  type="text/css">
```

The "normalized" version has [normalize.css](https://github.com/necolas/normalize.css/) baked in.
npm package: @jrc03c/base-web-component
Description: - Importantly, the base web component does _not_ register itself in the global custom element registry (i.e., it does not do `customElements.define("x-base", BaseComponent)`)! Therefore, it's up to you, the user of the library, to register it yourself. I 
Latest version: 0.0.18

# Notes

- Importantly, the base web component does _not_ register itself in the global custom element registry (i.e., it does not do `customElements.define("x-base", BaseComponent)`)! Therefore, it's up to you, the user of the library, to register it yourself. I don't like that it has to be that way, but registering the component from within the library seems to cause bundling issues downstream.
npm package: @jrc03c/custom-scroller
Description: ```bash npm install --save https://github.com/jrc03c/custom-scroller ```
Author: jrc03c
Latest version: 0.0.17

# Install

```bash
npm install --save https://github.com/jrc03c/custom-scroller
```

# Use

```html
<script src="path/to/custom-scroller.js"></script>
<script>
  const myScrollingElement = document.querySelector("#my-scrolling-element")
  const x = 50
  const y = 250
  const ms = 1500
  const linearEasing = x => x // optional; defaults to sine easing
  const scroller = new CustomScroller(myScrollingElement, linearEasing)

  scroller.scrollTo(x, y, ms).then(() => {
    // do something cool
  })
</script>
```

If you need to stop the scrolling suddenly, use `scroller.stop()` (which returns a `Promise` that resolves when the scroller has come to a standstill). Also, calling the `scrollTo` method before a previous scroll has finished will stop the previous scroll and start the new one.
npm package: @jrc03c/data-structures
Description: a little library of data structures i made for educational porpoises 🐬
Latest version: 0.0.2

# intro

a little library of data structures i made for educational porpoises 🐬

# installation

```bash
npm install --save @jrc03c/data-structures
```

# usage

```js
import { LinkedList } from "@jrc03c/data-structures"

const x = new LinkedList([1, 1, 2, 3, 5, 8, 13])
x.push(21)
x.push(34, 55, 89)
console.log(x.toArray())
// [
//    1,  1,  2,  3,  5,
//    8, 13, 21, 34, 55,
//   89
// ]
```

# api

## `LinkedList`

in general, the `LinkedList` class uses the same api as [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) but with a few small exceptions:

1. the constructor only accepts an array of values (or nothing at all). in other words, it does _not_ accept a length like the `Array` constructor does.
2. the class has `get` and `set` instance methods.
3. the class does not have the static methods `fromAsync` and `of`.
4. the class does not have the instance methods `copyWithin`, `fill`, `flat`, and `flatMap`.
5. in places where `Array` methods return `Array` instances (e.g., `filter`), the `LinkedList` methods return `LinkedList` instances.
6. in places where `Array` methods accept `Array` instances as arguments (e.g., `concat`), the `LinkedList` methods accept both `Array` instances and `LinkedList` instances.

### `LinkedList(x)` (constructor)

optionally accepts an array of values with which to populate the list.

### properties

#### `length` (getter)

returns the length of the list. is read-only.

### methods

#### `get(i)`

returns the value at index `i`.

#### `set(i, v)`

sets the value at index `i` to be `v`.

### examples

```js
import { LinkedList } from "@jrc03c/data-structures"

const x = new LinkedList([2, 3, 4])
x.push("foo")
x.push(true, false)
console.log(x.toArray())
// [ 2, 3, 4, 'foo', true, false ]

const y = x.slice(1, 4)
console.log(y)
// LinkedList {}
console.log(y.toArray())
// [ 3, 4, 'foo' ]

y.splice(1, 1, "bar")
console.log(y.toArray())
// [ 3, 'bar', 'foo' ]

const z = x.concat([Infinity, NaN])
console.log(z.toArray())
// [ 2, 3, 4, 'foo', true, false, Infinity, NaN ]

for (const value of z) {
  console.log(value)
}
// 2
// 3
// 4
// 'foo'
// true
// false
// Infinity
// NaN

const chars = new LinkedList(["a", "b", "c", "d", "e"])
console.log(chars.join(":"))
// 'a:b:c:d:e'

const fibs = new LinkedList([1, 1, 2, 3, 5, 8, 13])
console.log(fibs.reduce((a, b) => a + b))
// 33

fibs.sort((a, b) => b - a)
console.log(fibs.toArray())
// [
//   13, 8, 5, 3,
//    2, 1, 1
// ]
```
npm package: @jrc03c/emitter
Description: a small event emitter helper class
Author: jrc03c
Latest version: 0.0.6

# intro

a small event emitter class

# installation

```bash
npm install --save @jrc03c/emitter
```

# usage

```js
import { Emitter } from "@jrc03c/emitter"

const emitter = new Emitter()

emitter.on("random-number", v => {
  console.log(v)
})

emitter.emit("random-number", Math.random())
```

# api

## `Emitter`

### `Emitter()` (constructor)

takes no arguments.

### properties

#### `subscriptions`

an object whose key-value pairs represent channel names and arrays of callbacks, respectively.

### methods

#### `emit(channel, value1, value2, value3, ...)`

calls all of the callbacks subscribed to `channel` and passes to them as arguments the values `value1, value2, value3, ...`

#### `off(channel, callback)`

unsubscribes `callback` from `channel`.

#### `on(channel, callback)`

subscribes `callback` to `channel`. returns a function that, when called, will unsubscribe `callback` from `channel`. for example:

```js
import { Emitter } from "@jrc03c/emitter"

const emitter = new Emitter()

const unsubscribe = emitter.on("just-once", () => {
  console.log("once!")
  unsubscribe()
})

for (let i = 0; i < 100; i++) {
  emitter.emit("just-once")
}
```
npm package: @jrc03c/fake-jest
Description: a temporary jest stand-in for esm
Author: jrc03c
Latest version: 0.0.21

# Introduction

This package is a temporary stand-in for [Jest](https://jestjs.io/), which doesn't currently support ES modules (I think).

# Installation

```bash
npm install --save-dev @jrc03c/fake-jest
```

# Usage

**Step 1:** Write a test file:

```js
// my-cool-function.test.mjs
import { afterAll, beforeAll, expect, test } from "./index.mjs"
import { myCoolFunction } from "./my-cool-function.mjs"

beforeAll(() => {
  // set up
})

afterAll(() => {
  // tear down
})

test("that `myCoolFunction` works as expected", () => {
  expect(() => myCoolFunction()).not.toThrow()
})
```

**Step 2a:** Run the tests in `my-cool-function.test.mjs` by running it as a normal Node script:

```bash
node path/to/my-cool-function.test.mjs
```

...or by invoking the `fake-jest` executable and passing the path as an argument:

```bash
npx fake-jest path/to/my-cool-function.test.mjs
```

**Step 2b:** To run _all_ tests in a project, invoke the `fake-jest` executable with no arguments:

```bash
npx fake-jest
```
npm package: @jrc03c/misc-sdks
Description: This is a little library of SDKs for various APIs that I use at work. They're intentionally minimalistic and not intended to cover the entire surface area of every API they target.
Author: jrc03c
Latest version: 0.0.25

# Intro

This is a little library of SDKs for various APIs that I use at work. They're intentionally minimalistic and not intended to cover the entire surface area of every API they target.

# Installation

```bash
npm install @jrc03c/misc-sdks
```

# Usage

```js
import {
  AirtableClient,
  BaseClient,
  MailTmClient,
  MailchimpClient,
} from "@jrc03c/misc-sdks"
```
npm package: @jrc03c/progress
Description: makes a progress bar
Author: jrc03c
Latest version: 0.0.9

**progress** is a little package that draws a progress bar when iterating over an array in Node. It's kind of like [tqdm](https://tqdm.github.io/).

Install it:

```bash
npm install --save https://github.com/jrc03c/progress
```

Use it:

```js
const progress = require("progress")
const x = [5, 4, 3, 2, 1]

progress(x).forEach(value => {
  // do something with `value`;
  // while that's happening,
  // you should see a progress
  // bar at the bottom of the
  // terminal!
})
```

You can also set the progress bar value manually by passing either a fraction from 0 to 1 _or_ a numerator and denominator:

```js
progress(0.5) // 50%
progress(30, 60) // 50%
```
npm package: @jrc03c/rubber-band-scroller
Description: This little tool adds rubber-band-like scrolling to a web page.
Author: jrc03c
Latest version: 0.0.4

# Intro

This little tool adds rubber-band-like scrolling to a web page.

# Installation

```bash
npm install --save @jrc03c/rubber-band-scroller
```

# Usage

Add the script to your HTML:

<!-- prettier-ignore -->
```html
<script
  src="node_modules/@jrc03c/rubber-band-scroller/dist/rubber-band-scroller.js">
</script>
```

Or import for use with bundlers:

```js
const RubberBandScroller = require("rubber-band-scroller")
```

Then:

```js
const band = new RubberBandScroller({
  damping: 0.6,
  delay: 0,
  k: 0.3,
  mass: 1.5,
  maxSpeed: 1000,
  sensitivity: 1,
  target: { x: 0, y: 0 },
})

band.on("start", () => console.log("Started!"))
band.on("stop", () => console.log("Stopped!"))
band.on("arrive", () => console.log("Arrived!"))

band.start()
// band.stop()
```

Note that the `.stop()` method will _immediately_ stop the scrolling of the page regardless of whether the scroller has arrived at its target or not.

# Notes

- This is only designed to scroll the entire page, not particular elements. Maybe I'll add that functionality at some point.
npm package: @jrc03c/search
Description: This is a library of miniature search engines for small corpora. It's similar to [Lunr](https://lunrjs.com/) but less well-made. It offers multiple search engines to handle different scoring preferences and context considerations. For example, the `BM25Se
Author: @jrc03c
Latest version: 0.0.12

# Intro

This is a library of miniature search engines for small corpora. It's similar to [Lunr](https://lunrjs.com/) but less well-made. It offers multiple search engines to handle different scoring preferences and context considerations. For example, the `BM25SearchIndex` class — like Lunr — scores search results using the [Okapi BM25](https://en.wikipedia.org/wiki/Okapi_BM25) algorithm, which is useful for figuring out which documents best match some set of keywords; but the `FuzzySearchIndex` class scores search results by [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance), which is useful for handling incorrect spellings and finding similar-looking words and phrases.

# Installation

```bash
npm install --save @jrc03c/search
```

# Usage

The various search index classes have roughly the same API, so their usage should all be pretty similar. For example:

```js
// ...
```

In all classes, higher scores mean better matches (though the exact score ranges differ across classes).

## Non-string documents

All of the search indices also support the processing of non-string documents. For example:

```js
import { FuzzyBM25SearchIndex } from "@jrc03c/search"

const docs = [
  { name: "Alice", age: 23, position: "Teacher" },
  { name: "Bob", age: 45, position: "Administrator" },
  { name: "Cheryl", age: 67, position: "Support Technician" },
]

const index = new FuzzyBM25SearchIndex()
index.process(docs)
console.log(index.search("Alicia"))
// ...
```

## Saving and loading an index

Search indices can be saved to disk for later use. For example:

```js
import { SearchIndex } from "@jrc03c/search"
import fs from "node:fs"

const docs = [...]
const index = new SearchIndex()
index.process(docs)

const indexFile = "path/to/index.json"
fs.writeFileSync(indexFile, JSON.stringify(index), "utf8")

// And then sometime later:
!(() => {
  const index = new SearchIndex(JSON.parse(fs.readFileSync(indexFile, "utf8")))
  console.log(index.search("some query"))
})()
```

## Model strengths and weaknesses

**🚧 UNDER CONSTRUCTION 🚧**

# API

**🚧 UNDER CONSTRUCTION 🚧**
npm package: @jrc03c/web-game-framework
Description: A very simple, experimental web game framework.
Latest version: 0.0.6

# Intro

A very simple, experimental web game framework.

# Installation

```bash
npm install --save @jrc03c/web-game-framework
```

# API

## `Component`

🚧 UNDER CONSTRUCTION 🚧

## `Mouse`

🚧 UNDER CONSTRUCTION 🚧

## `Point`

🚧 UNDER CONSTRUCTION 🚧

## `Rect`

🚧 UNDER CONSTRUCTION 🚧

## `Scene`

🚧 UNDER CONSTRUCTION 🚧

## `SceneWithUpdateLoop`

🚧 UNDER CONSTRUCTION 🚧

## `Thing`

🚧 UNDER CONSTRUCTION 🚧

## `Vector2`

🚧 UNDER CONSTRUCTION 🚧
npm package: @jrc03c/web-worker-helper
Description: This tool makes it a little easier to interact with Web Workers.
Author: jrc03c
Latest version: 0.0.11

# Intro

This tool makes it a little easier to interact with Web Workers.

# Installation

```bash
npm install --save @jrc03c/web-worker-helper
```

# Usage

🚧 **UNDER CONSTRUCTION** 🚧

# API

🚧 **UNDER CONSTRUCTION** 🚧

# Notes

I've been using [Parcel](https://parceljs.org/) in all of my testing, and it pairs very well with this tool. Your mileage may vary with other bundlers.