Skip to content

Using Packages

Install a Package

sh
wyn pkg install sqlite

Or add to wyn.toml:

toml
[dependencies]
sqlite = "^1.0"

Then wyn pkg install to fetch all dependencies.

Import in Code

wyn
import sqlite

fn main() -> int {
    var db = Db.open(":memory:")
    Db.exec(db, "CREATE TABLE users (name TEXT)")
    return 0
}

Package Commands

sh
wyn pkg search <query>        # Search registry
wyn pkg info <name>           # Show details
wyn pkg install <name>        # Install latest
wyn pkg install <name>@<ver>  # Install specific version
wyn pkg uninstall <name>      # Remove
wyn pkg list                  # List installed
wyn pkg restore               # Install all from wyn.lock
wyn pkg push                  # Publish your package

Lockfile

When you install a package, Wyn writes a wyn.lock file pinning exact versions:

# wyn.lock — pinned package versions (do not edit)
sqlite 1.2.0 registry
redis 0.9.1 registry

Commit wyn.lock to version control. Team members run wyn pkg restore to get the same versions.

Official Packages

Wyn ships with 36 official packages including sqlite, redis, pg, gui, bcrypt, smtp, color, web, and more.

See Also

MIT License