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.
Check a package
Section titled “Check a package”noodle check hellocheck 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.
Build a package
Section titled “Build a package”noodle build hellobuild 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:
noodle build hello --out-dir distThe exported generated modules do not depend on the cache. Host companions and their resources retain their source-package resolution requirements.
Run an entry file
Section titled “Run an entry file”noodle run hello/hello.nlrun 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.
Run package tests
Section titled “Run package tests”noodle test hellotest 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.
Bundle an entry file
Section titled “Bundle an entry file”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.
Manage the cache
Section titled “Manage the cache”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.