Jik Packages

Official Jik packages can be found in the jik-packages repository. Clone the repository, point Jik at it, and import packages from your programs.

Set the Package Path

Jik resolves official packages from the directory configured by JIK_PKG_PATH. Set it to the root of a local jik-packages checkout.

Windows

git clone https://github.com/jik-lang/jik-packages C:\tools\jik-packages
set JIK_PKG_PATH=C:\tools\jik-packages
jik env

Linux

git clone https://github.com/jik-lang/jik-packages "$HOME/.local/share/jik-packages"
export JIK_PKG_PATH="$HOME/.local/share/jik-packages"
jik env

jik env prints the resolved package path as pkg_path=<path>.

Import a Package

Import packages by path from the configured package root. For example:

use "pkg/toml"

Package names and examples are listed in the jik-packages repository.

Update Packages

Pull the latest package changes from the checkout when you want to update your local package set.

cd C:\tools\jik-packages
git pull

On Linux, use the directory you chose for JIK_PKG_PATH, such as $HOME/.local/share/jik-packages.

Use a Specific Package Repository Version

Because JIK_PKG_PATH points at a local Git checkout, you can use normal Git commands to switch the package repository to a specific tag, branch, or commit. Package repository versions are separate from Jik compiler versions.

cd C:\tools\jik-packages
git fetch --tags
git checkout <tag-or-commit>