Wyrly has a small core model. Most applications only need five ideas: tokens, providers, containers, scopes, and lifetimes.Documentation Index
Fetch the complete documentation index at: https://docs.wyrly.dev/llms.txt
Use this file to discover all available pages before exploring further.
Tokens
A token is a runtime key with a TypeScript type.Providers
A provider tells the container how to create or return a dependency. Wyrly supports:useClassfor class-backed dependenciesuseValuefor constants and test doublesuseFactoryfor dependencies that need custom constructionuseExistingfor aliases
Containers
The root container owns application-wide registrations.Scopes
A scope is a child resolution context. In web apps, adapters usually create one scope per request.Lifetimes
| Lifetime | Meaning |
|---|---|
singleton | one instance for the root container |
scoped | one instance per scope |
transient | a new instance on each resolution |
Validation
Usecontainer.validate() to catch graph problems before production:
- missing providers
- circular dependencies
- invalid provider shapes
- lifetime violations