One command, sn, creates projects, manages dependencies, runs your
code and compiles it into executables that run without Sonata installed.
extension Modular
Build your own modules and organize multi-file structured projects
with ease. require("./util") loads files relative to the script, keeping your
code reusable, clear, and simple to maintain.
package_2 Package Manager
Manage your dependencies with the git-powered package manager. Any Git
repository is a package, and a lock file pins exact commits so builds stay reproducible.
inventory_2 Batteries included
15 built-in libraries for files, processes, TLS networking, JSON, YAML,
TOML, cryptography, time zones, compression, regex and more. No dependencies needed.
account_tree Tasks
Programs run on a scheduler. While one task waits on a socket, child
process, timer or channel, the others keep running.
rocket_launch Standalone executables
sn build bundles your project and its dependencies into one
file that runs anywhere, optionally with a smaller runtime holding only the libraries
you use.
sentiment_very_satisfied Easy to use
With Luau's simple syntax, powerful type system, and excellent performance,
combined with Sonata's builtin modules and loaders, you can build anything you can imagine
with ease.
From idea to executable
Scaffold a project, pull in a package straight from Git, run it, and ship a
single binary. It's all the same tool.
local fs = require("@sonata/fs")
local term = require("@sonata/term")
local task = require("@sonata/task")
-- Print every entry in the current directory,-- each one from its own taskfor _, name in fs.listDir(".") do
task.spawn(function()
term.stdout:writeLine(term.style(name, "bold", "cyan"))
end)
end
$ sn init hello
$ cd hello
$ sn pkg add github.com/acme/json5
$ sn run
Hello World!$ sn build
# standalone executable written to dist/
-- .sonata/project.luaureturn {
name = "myProject",
version = "0.1.0",
description = "A new Sonata project",
entrypoint = "main.luau",
authors = {},
dependencies = {},
}
Batteries included
Every library ships with Sonata. Import any of them with
require("@sonata/<name>").
The script downloads the latest release for your system into ~/.sonata
and adds ~/.sonata/bin to your PATH through your shell's rc
file. It needs curl or wget, and tar.