Skip to content

Adpt ​

The adapter layer provides a single, runtime-agnostic interface for Mayari's supported environments: Lune, Zune, and Lute. Instead of importing runtime-specific APIs directly.

Installation ​

bash
embr add mayari/adpt
embr i

Example ​

lua
local Adapter = require("adpt")

local fs = Adapter.fs
local net = Adapter.net
local json = Adapter.json
local process = Adapter.process
local task = Adapter.task

local data = fs.readFile("./config.json")
local parsed = json.decode(data)

This makes it easier to write code once and run it across supported runtimes without changing your imports.

What it provides ​

  • adapter.fs for filesystem access
  • adapter.net for networking
  • adapter.process for process-related operations
  • adapter.json for JSON encoding and decoding
  • adapter.task for task helpers

Current status ​

Support is intentionally partial. Not every runtime exposes the same capabilities, and some libraries available in one environment are not available in another. The adapter currently focuses on the shared subset of functionality that can be used consistently across supported runtimes.

If a feature is missing in a specific runtime, the adapter will follow the runtime's own capabilities rather than forcing a workaround that would be unreliable.