@dashkite/drn
v0.12.33
Published
Helpers for DashKite Resource Names
Readme
DRN
Dynamic Resource Names (DRN) core utilities.
DRNs are resource references that are independent of the deployment environment. They can take the form of URIs or specifier objects. They can be resolved at build or runtime to reference a specific. DRNs may reference domains, URLs, S3 buckets, or any thing for which a resolver is loaded.
import { resolve } from "@dashkite/drn"
resource = await resolve "drn:domain/www/pandastrike/com"Features
- Resolves uniquely: Generates a unique key for each branch and device that is used in resolution, ensuring the resolved names are unique for each environment.
- Extensible Resolvers: Easily add support for new resource types.
- URIs Or Objects: Convert between URIs and structured specifier objects.
- Deep Replacement: Automatically replace all DRN strings embedded within JavaScript objects with their resolved resources.
Installation
Use your favorite package manager to install:
pnpm add @dashkite/drnUsage
The core of DRN is the resolve function, which handles both individual strings and collections of DRNs.
import { resolve, replace } from "@dashkite/drn"
# Resolve a single DRN
item = await resolve "drn:type:name"
# Replace DRNs in a configuration object
config = await replace
endpoint: "drn:api:gateway"
timeout: 5000Other Resources
- Reference: API documentation for resolution, encoding, and registration.
- Recipes: Common patterns for using and extending DRNs.
Status
This software is currently in active development and is not yet suitable for production use. Please report bugs or request features via the repository's issue tracker.
