A JSON formatter for the @typed-prompt
ecosystem.
Enables strongly-typed prompt values to be formatted as JSON strings for flexible serialization and integration with AI workflows.
npm install @typed-prompt/json-formatter
Requires TypeScript ^5.x as a peer dependency.
@typed-prompt/json-formatter
provides a simple way to serialize prompt values into pretty-printed JSON format.
It is designed to work seamlessly within the @typed-prompt
family, supporting type-safe and composable prompt engineering.
-
JSONFormatter
: A class implementing theFormatter
interface, allowing customization of the property name under which the prompt is stored, as well as the spacing of the JSON output. -
jsonFormatter
: A function for formatting prompt values as JSON using default settings.
-
build
: Generate type definitions usingtsdown
.
MIT