open-index/open-npm huggingface dataset:
npm package: @hackbg/cmds
Description: Minimal command line parser.
Latest version: 4.0.0-rc.5

# @hackbg/cmds

**Tiny command parser.**

```typescript
import Commands from '@hackbg/cmds'

class MyCommands extends Commands {
  cmd1 = this.command('cmd1', 'command 1', () => {})
}

new MyCommands('my commands')
  .addCommand('cmd2', 'command 2', () => {}, () => {})
```

<div align="center">

---

Made with **#%&!** @ [**Hack.bg**](https://foss.hack.bg)

</div>
npm package: @hackbg/conf
Description: Command runner.
Latest version: 3.1.6

# @hackbg/conf

Loads configuration from environment.

Parses the values of "empty string", `false`, `no`, and `0` as negatives.

Example usage with TypeScript:

```typescript
import { Env, EnvConfig } from '@hackbg/conf'

export class MyConfig extends EnvConfig {

  /** This constructor must be copied into every subclass to support the passing of defaults.
    * This is dumb, TODO fix in next version. */
  constructor (
    env:      Env               = {},
    cwd:      string            = '',
    defaults: Partial<MyConfig> = {}
  ) {
    super(env, cwd)
    this.override(defaults)
  }

  /* If you provide no default, when the env var is not defined and error will be thrown */
  myStringField
    = this.getString('MY_STRING_FIELD')

  /* To provide a default value pass a function that returns the default */
  myNumberField
    = this.getNumber('MY_NUMBER_FIELD', () => 0)

  /* To provide a default value pass a function that returns the default */
  myBooleanField
    = this.getFlag('MY_BOOLEAN_FIELD', () =>
      this.getFlag('MY_FLAG',          () =>
      this.getFlag('MY_OTHER_FLAG',    () => {
        if (Math.random() > 0.5) {
          return true
        } else {
          return false
        }
      })))

}

const currentConfig = new MyConfig(process.env, process.cwd, /* {}: defaults */)
```

<div align="center">

---

Made with **#%&!** @ [**Hack.bg**](https://foss.hack.bg)

</div>
npm package: @hackbg/dock
Description: Docker utilities.
Latest version: 2.0.8

# @hackbg/dock

Want to run some operation from Node in a reproducible environment?
Here's a really simple way to achieve that with containers.

## Overview

This library builds upon [Dockerode](https://www.npmjs.com/package/dockerode),
and provides the `Engine`, `Image` and `Container` abstractions, which
make it easy and performant to package and run reproducible operations
(such as containerized builds or ETL pipelines).

* The **`Engine`** class connects to the Docker runtime at `/var/run/docker.sock`
  or the path specified by the `DOCKER_HOST` environment variable.
* The **`Image`** class supports specifying both an upstream tag to pull from Docker Hub,
  and/or a local fallback Dockerfile. This allows for fast iteration when constructing
  the Dockerized runtime environment.
* From an `Image` instance, you can launch one or more **`Container`**s.
  If you like, you can run multiple parallel operations in identical contexts
  (as specified by a single local `Dockerfile`), and the `Image` will
  build itself locally, only once and without touching Docker Hub.

## Example

```typescript
import Docker from '@hackbg/dock'

const engine = new Docker.Engine()

const image = engine.image(
  'my-org/my-build-image:v1', // This image will be pulled
  '/path/to/my/Dockerfile',   // If the pull fails, build from this Dockerfile
  [] // Any local paths referenced from the Dockerfile should be added here
)

const container = await image.run(`build_${+new Date()}`, {
 readonly: { '/my/project/sources':   '/src'  }, // -v ro
 writable: { '/my/project/artifacts': '/dist' }, // -v rw
 mapped: { 80: 8080 } // container:host
})
```

## Roadmap

* [ ] Support Podman for fully rootless operation

---

<div align="center">

Made with **#%&!** @ [**Hack.bg**](https://foss.hack.bg)

</div>
npm package: @hackbg/dokeres
Description: Docker utilities.
Latest version: 4.4.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@hackbg/dokeres`

Wanna run something from Node in a reproducible environment? Docker's your friend,
but `dockerode`'s API is a little rough around the edges.

This package defines the `Dokeres`, `DokeresImage` and `DockeresContainer` classes.
Use `DockerImage` to make sure a specified Docker Image exists on your system,
pulling or building it if it's missing.

Request the same image to be built multiple times and
it's smart enough to build it only once. This lets you e.g.
launch a zillion dockerized tasks in parallel, while being
sure that the same Docker image won't be pulled/built a zillion times.

Reexports `Docker` from `dockerode` for finer control.

## Example

```typescript
await new Dokeres().image(
  'my-org/my-build-image:v1', // tries to pull this first
  '/path/to/my/Dockerfile',   // builds from this manifest if pull fails
).run(                                              // docker run                           \
  'build-my-thing', {                               //   --name build-my-thing              \
     readonly: { '/my/project/sources':   '/src'  } //   -v /my/project/sources:/sources:ro \
     writable: { '/my/project/artifacts': '/dist' } //   -v /my/project/sources:/sources:rw \
  }                                                 //   my-org/my-build-image:v1
)
```
npm package: @hackbg/dump
Description: Use Braille characters to print binary data legibly. JS/TS version of Justinne Tunney's brailledump (https://justine.lol/braille/)
Latest version: 1.0.2

# @hackbg/dump

This package is our JS (well, TS) implementation of
[brailledump by the amazing Justinne Tunney](https://justine.lol/braille/).
It uses Braille characters to print binary data legibly.

```typescript
import { brailleDump } from '@hackbg/dump'
console.log(brailleDump(/* some Uint8Array */))
```

<div align="center">

---

Made with **#%&!** @ [**Hack.bg**](https://foss.hack.bg)

</div>