#Part 5. Libraries
#Part 5 Section 1. Learn These First
Most first apps need only a small library set.
| Library | Purpose |
|---|---|
CB-Console | Input and terminal output |
CB-Math | Checked numeric helpers and fallbacks |
CB-Storage | .cb saves |
CB-AssetLoader | Project assets |
CB-UI | HTML UI |
CB-Render | Direct drawing |
CB-Popup | User-facing error dialogs |
CB-Networking.HTTP | Outgoing web requests |
CB-Networking.API | Local routes or API clients |
CB-Security.Auth | Login/session checks |
CB-Security.RBAC | Role checks |
CB-Library.Testing | Assertions and small benchmarks |
CB-Library.Logging | Debug logs |
Import the libraries you use. A short import list makes missing functions easier to spot.
#Part 5 Section 2. Making A Library
A .cbl library should do one job clearly. Export stable functions and build it with compile library.
library CB-TextTools
fn CB-TextTools.slug(string text) -> string {
string lower = string.lower(text)
return string.replace(lower, " ", "-")
}
compile library CB-TextTools.cbp bin/CB-TextTools.cbl small compute
Place the compiled .cbl in the project libraries folder, then import it from another .cbp.
