Example programs demonstrating Covenant language features.
# Check syntax
covenant check examples/<dir>/<file>.cov
# Compile to WASM
covenant build examples/<dir>/<file>.cov -o output.wasm
# Run (Deno target)
covenant run examples/<dir>/<file>.cov
| Directory |
Description |
| syntax-fundamentals/ |
Core syntax: hello-world, pure functions, pattern matching, higher-order functions, text operations, regex |
| json/ |
JSON parsing, building, and validation |
| error-handling/ |
Union types, validation, and error recovery patterns |
| Directory |
Description |
| extern-bindings/ |
Declaring extern bindings to wrap JavaScript/npm libraries |
| using-bindings/ |
Using extern bindings in Covenant functions |
| Directory |
Description |
| query-system/ |
Comprehensive query examples: data nodes, document ingestion, embedded queries, parameterized queries, RAG retrieval, knowledge base, relation traversal, symbol metadata, performance benchmarks |
| project-queries/ |
Meta-queries on the symbol graph (find callers, dead code, etc.) |
| Directory |
Description |
| ast-mutations/ |
Refactoring operations: rename, add, prune |