Skip to content
Noodle
InstallLearnPlayground
GitHub

Everyday workflow

The Noodle command-line tool works with package directories and program entry files. A directory containing .nl files is already a package; it does not need an nlpkg.json manifest unless it has package-level configuration.

Terminal window
noodle check hello

check loads every module in the package and reports syntax, type, and other compile-time diagnostics. Use it for the fastest feedback when you do not need JavaScript output.

Terminal window
noodle build hello

build checks the package and stores derived artifacts in the user cache, ~/.noodle_cache/ by default. It prints the generated entry or binding directory; --json returns structured paths and cache hit/miss counts. Noodle emits ordinary modular JavaScript ESM: source modules remain visible as separate generated modules instead of being bundled into one user-program file.

Cached paths can be evicted once no command is using them. Export a build that must be kept or consumed by another tool:

Terminal window
noodle build hello --out-dir dist

The exported generated modules do not depend on the cache. Host companions and their resources retain their source-package resolution requirements.

Terminal window
noodle run hello/hello.nl

run receives a source file rather than a package directory. The selected file must declare exactly one non-generic main function with no parameters and a Unit result. An asynchronous main is also supported. The program runs in the directory from which you invoked the command.

Terminal window
noodle test hello

test checks the package, discovers its test declarations, and runs them in a separate test target. Tests may use private declarations from their own module and do not become part of production module exports. Each target’s tests run in that package’s source directory.

Terminal window
noodle build hello/hello.nl --wpo -o dist/hello.mjs

--wpo links the entry and everything it reaches into one ESM module. With -o, it exports the module, executable launcher and generated source/extern sidecars to the selected output directory. Without -o, the result stays in the cache. Ship the exported output closure together.

noodle cache info reports total and protected bytes; cache gc evicts old unused results, and cache clean removes all unprotected results. Active builds, programs and language-server consumers remain protected.

The default limit is 10 GiB. Configure ~/.config/noodle/config.json:

{"cache":{"directory":"~/.noodle_cache","max_size_bytes":"10737418240"}}

NOODLE_CACHE_DIR and NOODLE_CACHE_MAX_BYTES override these values. The byte count is a positive decimal string so large limits remain exact. Protected content may temporarily exceed the limit and becomes eligible for eviction after its consumers finish.

Run an exported WPO program through its generated executable launcher. The launcher handles the selected entry and its asynchronous lifetime. Module boundaries and generated names inside the bundle are not a public interface. Field names are renamed too, so a host companion that reads or builds a value needs the field marked with @link — see Extern bindings.

Continue with the language overview.