zephyr.package

Metadata and file loaders for the current module. Also exposes the value fields `id`, `name`, `version`, and `settings` (manifest settings merged with `.runtime-config.json` overrides; all values are strings).

2 functions

include

zephyr.package.include(path)

Load and evaluate a Lua file from the module root, every call.

Identical to the global include. Uses a safe path join that rejects parent traversal and only accepts components beneath the module root.

Parameters

pathstring

Module-relative path to a Lua file.

Returns

any

The file's exported value.

Example

lua
local helper = zephyr.package.include("helper.lua")

import

zephyr.package.import(path)

Load a Lua file from the module root once and cache its non-nil export.

Identical to the global import. Exports that evaluate to nil are not cached.

Parameters

pathstring

Module-relative path to a Lua file.

Returns

any

The file's exported value, cached after the first call.

Example

lua
local schema = zephyr.package.import("schema.lua")