peelkit
v0.1.0-alpha
Published
The whole Peelkit toolkit: `peelkit` without Effect in its API (sync functions, typed errors, Promises for I/O), `peelkit/effect` Effect-native.
Readme
peelkit
Templates people fill in, and the documents they produce: questions that follow the content, forms, documents in HTML, Markdown, PDF, Word and email, a template creator and the process around them. Plain TypeScript, built on Effect.
Alpha. The API will change between alphas, and it has not been tried in real products yet.
npm install peelkit effectimport { Form, Generator, Template } from "peelkit"
const template = Template.decode(await response.json()) // throws TemplateDecodeError
const form = Form.make(template)
form.setValue("clientName", "Globex")
const submitted = form.submit() // { ok: true, value } | { ok: false, error }
if (submitted.ok) console.log(Generator.render(template, submitted.value, "html"))- Pure work (decoding, validating, generating) is synchronous and throws typed errors; each has a
safe…twin that returns{ ok, value | error }. I/O returns Promises. Nothing reads the clock, files or the network: your app passes those in. peelkit/effectis the same toolkit, Effect-native.- Next to it, add what your app needs: a renderer (
@peely/pdf-takumi,@peely/docx,@peely/email), or@peely/tiptapto write templates in a TipTap editor. Framework bindings come in a later release. npx peelkitsets up a project: framework-aware blocks (routes that generate documents, templates) copied into your code.
Documentation: github.com/peely-io/peelkit. MIT licensed.
