Skip to main content

Rust powered c-module for nanos world

NanosQuark

Native utilities for nanos world

Cryptography, networking, data formats, compression and fast native computation for your server scripts, all from one global Quark.

Off the game thread

Heavy work runs on native worker threads. Results come back as callbacks, promises or awaits, without stalling the tick.

Safe by default

Linear time regex for player input, sandboxed workers, network allow lists and errors with the script location.

Free when unused

Modules are built on first access. Leave entire modules out at compile time with Cargo features.

Await native work

local Crypto = Quark.Import("Crypto")

Player.Subscribe("Spawn", function(player)
Quark.Async(function()
local hash = Quark.Await(Crypto.Argon2Hash, "secret")
Console.Log("stored " .. hash)
end)
end)

Serve HTTP from the game server

local server = Quark.HTTP.Listen(8080)

server:Get("/players", function(request, response)
local names = {}
for _, player in ipairs(Player.GetAll()) do
table.insert(names, player:GetName())
end
response:Json(names)
end)

Add Quark to your server

Copy the package, require it and start the server with unsafe libraries enabled.

Installation guide