open-index/open-npm huggingface dataset:
npm package: @rasch/argv
Description: a command-line argument parser
Author: Rand Schneck
Latest version: 0.1.2

# argv

> a command-line argument parser for ECMAScript CLI applications

This `argv` module accepts an array of strings containing the command line
arguments and reduces them to an object of key-value pairs. Any arguments that
don't have an option associated with them are appended to an array on the `_`
(underscore) key. Arguments appearing after "--" are also appended to the array
on the `_` key. Negated arguments such as, `--no-opt` will set `opt: false` on
the `argv` object. All of the values in the `argv` object are strings or
booleans.

```javascript
// example.js
import { argv } from "@rasch/argv"
console.log(argv(process.argv.slice(2)))
```

```sh
node example.js serve -v 3 -xyz --host=127.0.0.1 -p80 --no-debug -q
```

```javascript
{
  _: ["serve"],
  v: "3",
  x: true,
  y: true,
  z: true,
  host: "127.0.0.1"
  p: "80",
  debug: false,
  q: true,
}
```

[Additional usage examples](test.js) are available in the unit tests.

## install

```sh
pnpm add @rasch/argv
```

<details><summary>npm</summary><p>

```sh
npm install @rasch/argv
```

</p></details>
<details><summary>yarn</summary><p>

```sh
yarn add @rasch/argv
```

</p></details>

## license

[0BSD](LICENSE)
npm package: @rasch/fraktur
Description: 𝕮𝔬𝔫𝔳𝔢𝔯𝔱 𝔩𝔢𝔱𝔱𝔢𝔯𝔰 𝔣𝔯𝔬𝔪 𝔱𝔥𝔢 𝔈𝔫𝔤𝔩𝔦𝔰𝔥 𝔞𝔩𝔭𝔥𝔞𝔟𝔢𝔱 𝔱𝔬 𝔉𝔯𝔞𝔨𝔱𝔲𝔯 𝔲𝔫𝔦𝔠𝔬𝔡𝔢 𝔠𝔬𝔡𝔢𝔭𝔬𝔦𝔫𝔱𝔰
Author: Randy Schneck
Latest version: 0.1.0

# 𝔉𝔯𝔞𝔨𝔱𝔲𝔯

𝕮𝔬𝔫𝔳𝔢𝔯𝔱 𝔩𝔢𝔱𝔱𝔢𝔯𝔰 𝔣𝔯𝔬𝔪 𝔱𝔥𝔢 𝔈𝔫𝔤𝔩𝔦𝔰𝔥 𝔞𝔩𝔭𝔥𝔞𝔟𝔢𝔱 𝔱𝔬 𝔉𝔯𝔞𝔨𝔱𝔲𝔯 𝔲𝔫𝔦𝔠𝔬𝔡𝔢 𝔠𝔬𝔡𝔢𝔭𝔬𝔦𝔫𝔱𝔰.

# 𝕴𝔫𝔰𝔱𝔞𝔩𝔩

```sh
npm install @rasch/fraktur
```

# 𝔘𝔰𝔞𝔤𝔢

```javasript
import { encode, decode } from "@rasch/fraktur"

encode("hello world")
// => 𝔥𝔢𝔩𝔩𝔬 𝔴𝔬𝔯𝔩𝔡

decode("𝔥𝔢𝔩𝔩𝔬 𝔴𝔬𝔯𝔩𝔡")
// => hello world
```

# 𝕮𝔬𝔪𝔪𝔞𝔫𝔡 𝔏𝔦𝔫𝔢 𝕴𝔫𝔱𝔢𝔯𝔣𝔞𝔠𝔢

```sh
echo 'hello world' | fraktur
# 𝔥𝔢𝔩𝔩𝔬 𝔴𝔬𝔯𝔩𝔡

echo '𝔥𝔢𝔩𝔩𝔬 𝔴𝔬𝔯𝔩𝔡' | fraktur -d
# hello world

fraktur <<EOF
All at once the wolves began to howl as though the
moonlight had had some peculiar effect on them.
EOF
# 𝔄𝔩𝔩 𝔞𝔱 𝔬𝔫𝔠𝔢 𝔱𝔥𝔢 𝔴𝔬𝔩𝔳𝔢𝔰 𝔟𝔢𝔤𝔞𝔫 𝔱𝔬 𝔥𝔬𝔴𝔩 𝔞𝔰 𝔱𝔥𝔬𝔲𝔤𝔥 𝔱𝔥𝔢
# 𝔪𝔬𝔬𝔫𝔩𝔦𝔤𝔥𝔱 𝔥𝔞𝔡 𝔥𝔞𝔡 𝔰𝔬𝔪𝔢 𝔭𝔢𝔠𝔲𝔩𝔦𝔞𝔯 𝔢𝔣𝔣𝔢𝔠𝔱 𝔬𝔫 𝔱𝔥𝔢𝔪.
```
npm package: @rasch/imgur-cli
Description: a CLI to upload images to imgur
Author: Randy Schneck
Latest version: 0.1.0

# imgur-cli

Uploads an image to [imgur](https://imgur.com), then displays the url and
deletehash.

## Usage

Upload an image from a URL or a file path.

```txt
imgur <url|path>
```

Delete an image from imgur using the `deletehash` that is shown when uploading
the image.

```txt
imgur del <deletehash>
```

## Install

```sh
pnpm add --global @rasch/imgur-cli
```

<details><summary>npm</summary><p>

```sh
npm install --global @rasch/imgur-cli
```

</p></details>
<details><summary>yarn</summary><p>

```sh
yarn global add @rasch/imgur-cli
```

</p></details>

## Examples

```txt
$ imgur example.png
http://i.imgur.com/xxxxxxx.png
deletehash: xxxxxxxxxxxxxxx
$ imgur del xxxxxxxxxxxxxxx
image has been deleted
$ imgur http://example.com/img.gif
```
npm package: @rasch/interject
Description: a string interpolation module
Author: Randy Schneck
Latest version: 0.2.0

# interject

`interject` is a JavaScript module for basic string interpolation.

```javascript
import { interject } from "@rasch/interject"

const user = {
  firstName: "Quinn",
  lastName: "Jones",
  email: "qjones@example.com",
}

const template = interject("{firstName} {lastName} <{email}>")

template(user)
// => 'Quinn Jones <qjones@example.com>'
```

## Installation

```sh
npm install @rasch/interject
```

## API

Include the module.

```javascript
import { interject } from "@rasch/interject"
```

Use function parameters to pass individual positional substitutions.

```javascript
interject('{0}, {1}')('Hello', 'world')
// => 'Hello, world'
```

Use an array to pass positional substitutions.

```javascript
interject('{0}, {1}')(['Hello', 'world'])
// => 'Hello, world'
```

Use an object to pass named substitutions.

```javascript
interject('{greeting}, {thing}')({ greeting: 'Hello', thing: 'world'})
// => 'Hello, world'
```
npm package: @rasch/note
Description: ultra minimal shell script for CLI notes
Author: Randy Schneck
Latest version: 0.1.0

# note

> Ultra minimal shell script for CLI notes

## Usage

Notes are created in `NOTE_DIR/YYYY-MM.txt` files, where YYYY-MM is the current
year and month.

```sh
# Set the note directory using the NOTE_DIR environment variable in the
# shell configuration file, such as `.bashrc`, `.profile`, etc.
NOTE_DIR=/data/note

# write a note in NOTE_DIR
n A little note to myself
n "Don't forget to quote or escape as needed"


# write command output to note file
ls logs/ | n

# open the note file
n

# multiline note
cat <<EOF | n
some text on line one
and line two
line 3, etc.
EOF

# or use a quoted string with literal line breaks
n 'hello, i am a multi-
line string'
```
npm package: @rasch/pb
Description: share [encrypted] files using 0x0.st
Author: Randy Schneck
Latest version: 0.1.0

# pb

Upload files to [0x0.st](https://0x0.st), then display the url. The file is
deleted after 14 days. There is a file size limit of 512MB.

## Usage

Upload a file or directory. Directories are compressed using tar and gzip. Pass
the `-e` option to encrypt the file using GnuPG before uploading.

```txt
pb <file|directory>
pb -e <file|directory>
```

The `pb` script also accepts stdin.

```txt
... | pb
... | pb -e
```

## Install

```sh
pnpm add --global @rasch/pb
```

<details><summary>npm</summary><p>

```sh
npm install --global @rasch/pb
```

</p></details>
<details><summary>yarn</summary><p>

```sh
yarn global add @rasch/pb
```

</p></details>
npm package: @rasch/pt
Description: a command-line pomodoro interval timer
Author: Randy Schneck
Latest version: 0.1.2

# pomodoro

🍅 pomodoro timer in the browser tab

All configuration is done in the query string of the URL. Create your own
interval timers and bookmark them!

| parameter | default | range   | description                                 |
|:---------:|:-------:|:-------:|:-------------------------------------------:|
| c         | 0       | 0-99    | number of pomodoros completed               |
| w         | 1500    | 1-86399 | work time in seconds                        |
| b         | 300     | 1-86399 | break time in seconds                       |
| l         | 1200    | 1-86399 | long break in seconds (every 4th break)     |
| x         | 3000    | 1-86399 | extended break in seconds (every 8th break) |
| v         | 0       | 0-100   | beep volume in percent                      |

## examples

- Pomodoro timer: The default pomodoro timer has 25 minute work periods and 5
  minute breaks. Every 4th break is 20 minutes and every 8th break is 50
  minutes. Note that the beep volume is set to 15% in this example.
  The volume defaults to 0 and isn't audible unless it's set.

      https://rasch.co/pt/?v=15

- Tabata timer: 8 cycles of 20 seconds of work and 10 seconds of rest for a
  total of 3 minutes and 50 seconds and then followed by an extended 4 minute
  break before starting another round. The beep volume is set to 25%, which may
  need to be adjusted for personal preferences.

      https://rasch.co/pt/?w=20&b=10&l=10&x=240&v=25

- Countdown timer: Countdown from 23 hours, 59 minutes, and 59 seconds. Note
  the breaks will still occur and the countdown will begin again.

      https://rasch.co/pt/?w=86399&v=15

## why no stop/pause button?

This timer is specifically designed for pomodoros and tabatas which don't allow
pausing. If you have to pause, you actually have to start over. With this timer
the query string parameter `c` can be used to restart the round that was
interrupted. For example, to start at round 5:

    https://rasch.co/pt/?v=15&c=5

## run locally

The website is easy to run locally since it's static with no build step.

```sh
git clone https://github.com/rasch/pomodoro.git
cd pomodoro

# serve with static web server such as darkhttpd
darkhttpd .
```

## cli

There is also a command line node application available. The `play` command from
the `sox` package needs to be installed for the notification sound to work.

```sh
npm install -g @rasch/pt
pt -h
```
npm package: @rasch/pubsub
Description: ultra minimal pubsub module
Author: Randy Schneck
Latest version: 0.2.0

# pubsub

ultra-minimal pubsub module written in TypeScript

## install

```sh
pnpm add @rasch/pubsub
# or with bun
bun add @rasch/pubsub
```

## usage

```js
import { publish, subscribe, unsubscribe } from "@rasch/pubsub"
import { welcome, tryagain } from "./fakeCallbackFunctions.js"

subscribe("login", welcome)
subscribe("loginError", tryagain)

if (user.isLoggedIn()) {
  publish("login", user.name)
} else {
  publish("loginError", `Incorrect username "${user.name}" or password!`)
}

unsubscribe("*")
```

## api

### subscribe

```txt
subscribe :: string -> (...a -> void) -> void
```

Attach a callback function to an event.

```typescript
subscribe("event", myFunction)
```

### publish

```txt
publish :: (string, ...a) -> void
```

Run all of the functions attached to an event with the given arguments.

```typescript
publish("event", arg)
publish("event", arg1, arg2, ...)
```

### unsubscribe

```txt
unsubscribe :: (string, ((...a -> void) | undefined)) -> void
```

Stop listening for events.

```typescript
// stop listening to a single event callback function
unsubscribe("event", myFunction)

// stop listening for all callback functions on event
unsubscribe("event")

// cancel all subscriptions
unsubscribe("*")
```
npm package: @rasch/speed
Description: speed read stdin
Author: Randy Schneck
Latest version: 0.1.0

# speed

![speed in action](https://i.imgur.com/OJn4CBA.gif)

Speed read text in the terminal. Just pipe your stdin and be ready to GO!
`speed.js` accepts two arguments. The first is the speed (default: 250) in words
per minute and the second is the word number to begin at (default: 1). Use
`ctrl-c` to quit. When quitting, the command to resume where you left off is
printed to stdout.

```sh
cat poem.txt | speed 700
curl -s 'https://baconipsum.com/api/?type=meat-and-filler&format=text' | speed 500
```

## install

```sh
pnpm add --global @rasch/speed
```

<details><summary>npm</summary><p>

```sh
npm install --global @rasch/speed
```

</p></details>
<details><summary>yarn</summary><p>

```sh
yarn global add @rasch/speed
```

</p></details>
npm package: @rasch/transfer
Description: share [encrypted] files using transfer.sh
Author: Randy Schneck
Latest version: 0.1.0

# transfer

Upload files to [transfer.sh](https://transfer.sh), then display the url. The
file is deleted after 14 days.

## Usage

Upload a file or directory. Directories are compressed using tar and gzip. Pass
the `-e` option to encrypt the file using GnuPG before uploading.

```txt
transfer <file|directory>
transfer -e <file|directory>
```

The `transfer` script also accepts stdin.

```txt
... | transfer <file_name>
... | transfer -e <file_name>
```

## Install

```sh
pnpm add --global @rasch/transfer
```

<details><summary>npm</summary><p>

```sh
npm install --global @rasch/transfer
```

</p></details>
<details><summary>yarn</summary><p>

```sh
yarn global add @rasch/transfer
```

</p></details>