open-index/open-npm huggingface dataset:
npm package: @korulang/gzip
Description: Gzip compression for Koru - compile-time or runtime
Author: Koru Contributors
Latest version: 0.0.1

# @korulang/gzip

Gzip compression for [Koru](https://korulang.org) - works at both compile-time and runtime.

Wraps **zlib** - the industry standard, battle-tested for 30+ years.

## Installation

```bash
koruc app.kz i
```

In your `app.kz`:
```koru
~std.package:requires.npm { "@korulang/gzip": "^0.0.1" }
```

Requires zlib installed on your system (available by default on macOS/Linux).

## Usage

### Compression

```koru
~import "$koru/gzip"

~koru.gzip:compress(data: my_content, allocator: allocator)
| compressed c |>
    // c.data contains gzipped bytes
    // c.original_size for compression ratio stats
| error e |>
    // e.msg describes what went wrong
```

### With Compression Level

```koru
~koru.gzip:compress(data: content, level: .best, allocator: allocator)
| compressed c |> ...
```

Levels:
- `.fast` - Fastest (zlib level 1)
- `.default` - Balanced (zlib level 6)
- `.best` - Smallest output (zlib level 9)

### Decompression

```koru
~koru.gzip:decompress(data: gzipped_bytes, allocator: allocator)
| decompressed d |>
    // d.data is the original content
| error e |>
    // Invalid gzip, corrupted, etc.
```

### Compile-Time Compression (Orisha pattern)

```koru
// In your route collector or build script
~koru.gzip:compress_bytes(data: file_content, allocator: allocator)
| ok c |>
    // c.data is now gzipped, embed into binary
    // Add Content-Encoding: gzip header
| error |>
    // Fall back to uncompressed
```

## API

| Event | Input | Output |
|-------|-------|--------|
| `compress` | `data`, `level?`, `allocator` | `compressed { data, original_size }` or `error { msg }` |
| `compress_bytes` | `data`, `allocator` | `ok { data }` or `error { msg }` |
| `decompress` | `data`, `allocator` | `decompressed { data }` or `error { msg }` |

## The "Deleted Work" Pattern

This library is designed for Koru's compile-time philosophy:

```
Traditional:
  Request -> Read file -> Compress -> Send
  (Every. Single. Request.)

Koru + @korulang/gzip:
  Compile time: Read file -> Compress -> Embed
  Runtime: Request -> Send pre-compressed blob
  (Compression happened ONCE, during build)
```

## Used By

- [Orisha](https://github.com/korulang/orisha) - Compile-time HTTP server

## Implementation

Wraps system zlib via `@cImport`. Uses `deflateInit2` with `windowBits=31` for gzip format.

## License

MIT
npm package: @korulang/koru
Description: Koru - The event continuation language
Author: Koru Language Team
Latest version: 0.1.6

# Koru

The event continuation language.

## Install

```bash
npm install -g @korulang/koru
```

## Dependencies

Koru needs **[Zig](https://ziglang.org/download/) 0.15+**

Install it however you like:
- [ziglang.org/download](https://ziglang.org/download/)
- `brew install zig` (macOS)
- `pacman -S zig` (Arch)

Or let koruc install it for you:

```bash
koruc deps install
```

Then add the path it tells you to your shell, and verify:

```bash
koruc deps
```

```
Dependencies:

  zig ✓ 0.15.1

Ready!
```

## Usage

```bash
koruc your-file.kz
```

## Learn More

- [korulang.org](https://korulang.org) - Documentation
- [Getting Started](https://korulang.org/learn/getting-started)
- [GitHub](https://github.com/korulang/koru)
npm package: @korulang/sqlite3
Description: SQLite3 bindings for Koru with phantom type obligations
Author: Koru Contributors
Latest version: 0.0.1

# @korulang/sqlite3

SQLite3 bindings for [Koru](https://korulang.org) with phantom type obligations.

## Installation

```bash
koruc app.kz i
```

In your `app.kz`:
```koru
~std.package:requires.npm { "@korulang/sqlite3": "^0.0.1" }
```

## Requirements

- SQLite3 development libraries installed on your system
  - macOS: `brew install sqlite3` (usually pre-installed)
  - Ubuntu/Debian: `apt install libsqlite3-dev`
  - Fedora: `dnf install sqlite-devel`

## Usage

```koru
~import "$koru/sqlite"

// Open a database (in-memory or file)
~koru.sqlite:open(path: ":memory:")
| db d |>
    // Execute SQL
    koru.sqlite:exec(d.conn, "CREATE TABLE users (id INTEGER, name TEXT)")
    | ok c |>
        koru.sqlite:exec(c.conn, "INSERT INTO users VALUES (1, 'Alice')")
        | ok c2 |>
            // Query with prepared statements
            koru.sqlite:query(c2.conn, "SELECT * FROM users")
            | row r |>
                koru.sqlite:col.int(r.stmt, 0)
                | value v |>
                    koru.sqlite:col.text(v.stmt, 1)
                    | value t |>
                        // Use t.text here (borrowed from statement)
                        koru.sqlite:next(r.conn, t.stmt)
                        | done conn |>
                            koru.sqlite:close(conn.conn)
                            | closed |> _
            | empty c3 |>
                koru.sqlite:close(c3.conn)
                | closed |> _
| err e |> _
```

## API

### Connection Management

- `open { path: []const u8 }` - Open database, returns `| db { conn[opened!] }` or `| err`
- `close { conn[!opened] }` - Close connection, returns `| closed`

### Query Execution

- `exec { conn[opened!], sql }` - Execute SQL without results, returns `| ok { conn }` or `| err`
- `query { conn[opened!], sql }` - Prepare and step, returns `| row { conn, stmt[prepared!] }`, `| empty`, or `| err`
- `next { conn[opened!], stmt[prepared!] }` - Get next row, returns `| row`, `| done`, or `| err`

### Column Access

- `col.int { stmt[prepared!], index }` - Get integer column
- `col.text { stmt[prepared!], index }` - Get text column (borrowed pointer, valid until next step)
- `col.real { stmt[prepared!], index }` - Get float column

## Phantom Types

This library uses Koru's phantom type system for compile-time safety:

- `Connection[opened!]` - Connection is open, must be closed
- `Statement[prepared!]` - Statement is prepared, will be auto-finalized

The compiler ensures you can't use a closed connection or forget to close an open one.

## License

MIT