Korr

Packages

Docs index

Korr packages are Git repositories. korr add downloads one into korr_modules/, records it in korr.json, pins the exact commit in korr.lock, and import "name" uses it. There is no central registry: share a package by pushing it to GitHub (or any Git host) and tagging versions.

Using packages

korr init                                    # creates korr.json in this folder
korr add github:ana/korr-slug@v1.2.0         # add + install (name: slug)
korr add https://git.example.com/tools.git   # any HTTPS Git URL, latest commit
korr add github:ana/date-utils --name dates  # choose the import name
korr add file:///home/me/code/mylib          # a local repository
korr install                                 # install everything (e.g. after git clone)
korr list                                    # installed packages and commits
korr remove slug
// no-check
import "slug"                 // korr_modules/slug
import "date-utils"           // alias: date_utils (a "-" becomes "_")
import "dates" as d           // explicit alias

print(slug.make("Hello World"))

Writing a package

A package is a folder of .krr files in a Git repository. Add a korr.json:

{
  "name": "slug",
  "version": "1.2.0",
  "main": "main.krr",
  "dependencies": {
    "unicode": "github:ana/korr-unicode@v0.4.0"
  }
}

Security

A package is code that runs with the same permissions as your program, the same as npm, Composer or pip packages. Add packages you trust, pin versions with tags, and review changes when you update. The lock file makes sure nobody silently gets different code: a package changes only when you run korr add again.


Previous: CLI apps and the korr command Docs index Next: Deployment