Skip to Content
Drash v3 is in beta. APIs may change.
ReferenceStandardBuildersBuilder

Builder

The builder contract Standard declares for itself. Type-only — it does not exist at runtime.

import type { Builder } from "@drashland/drash/standard/builders/Builder.js";
interface Builder<C> { build(): C; }

C is what build() returns — the finished object (aka product), not the builder.

Who Implements It

ImplementerObject (aka Product)Declared in
ResponseBuilderResponsemodules/builders/ResponseBuilder.js
ETagResponseBuilderResponsemodules/middleware/e_tag/ETagResponse.js
RateLimitResponseBuilderResponsemodules/middleware/rate_limiter/RateLimitResponse.js

The last two extend ResponseBuilder, so they inherit the contract rather than declaring it again. See Builders for what each one does.

Its Relationship to IBuilder

Core declares IBuilder<Product> with the same single build() method. The two are structurally identical and genuinely duplicated — Standard is allowed to import from Core, so nothing forces the second declaration.

Which one a class implements is a matter of where it sits:

ContractImplemented by
IBuilder (Core)AbstractChainBuilder, the resource group builder
Builder<C> (Standard)ResponseBuilder and its two subclasses

RequestBuilder implements neither — it just has a build() method.

Because both are structural, a class satisfying one satisfies the other. The distinction matters for reading the source, not for writing against it.

Three Things Named Builder

Worth knowing before you go looking for one:

NameDeclared inWhat it is
IBuilder<Product>core/interfaces/IBuilder.jsCore’s contract
Builder<C>standard/builders/Builder.jsThis page — Standard’s contract
Buildermodules/builders/RequestChainBuilder.jsThe chain builder’s own public surface, unrelated to the others

The third is what Application.builder() returns. Despite the name, it does not implement either contract above — it is a separate interface declaring resources(), urlPatternClass(), and build().

Last updated on