Using Packages
Install a Package
sh
wyn pkg install sqliteOr 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 packageLockfile
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 registryCommit 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
- Creating Packages — publish your own
- Package CI — automated testing for packages
- CLI Commands —
wyn pkgcommands