New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@askdown/core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@askdown/core

Parser, serializer and validator for Askdown, a Markdown-like language for forms.

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@askdown/core

Parser, serializer and validator for Askdown, a Markdown-like language for forms.

npm install @askdown/core
import { parse, serialize, validateResponse } from '@askdown/core';

const { form, diagnostics } = parse(`
? Name *
___

? Will you attend?
- ( ) Yes
- ( ) No
`);

serialize(form); // canonical Askdown text

validateResponse(form, { name: 'Ada', 'will-you-attend': 'Yes' });
// { valid: true, errors: [], answers: { ... }, pages: [0] }

Zero dependencies. Runs in browsers, Node.js, Deno, Bun and Cloudflare Workers.

API

Function
parse(source)Parse Askdown text into { form, diagnostics, locations }. Never throws.
serialize(form, { explicitIds? })Convert a form to canonical Askdown text.
pinIds(source)Add {#id} to every question and page without one, changing only those lines.
validateForm(form)Check rules the JSON Schema can't express (unique ids, jump targets…).
validateResponse(form, answers)Validate and normalize a response, following jumps.
checkAnswer(question, value)Validate a single answer.
nextPage(form, pageIndex, answers), visitedPages(form, answers)Branching logic.
renderMarkdown(md), renderInline(md)The safe Markdown subset used in forms.

The JSON form model is described by the JSON Schema and the spec.

Keywords

forms

FAQs

Package last updated on 13 Oct 2026

Related posts