npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

conformal

v2.1.2

Published

Type-safe form submissions for the modern web.

Readme

Conformal

Type-safe form submissions for the modern web.

Conformal helps you work with native FormData. It solves two major pain points:

  • Strongly typed FormData parsing – Turn native FormData into real objects with full TypeScript inference (nested objects and arrays with dot/bracket notation).
  • Canonical submission flow – A single Submission object that preserves raw input, separates field vs. form errors, and standardizes the success/error states.

Works everywhere: In browsers, Node.js, and edge runtimes with React, Vue, Svelte, or vanilla JavaScript.

Table of Contents

Getting Started

Install Conformal via npm or the package manager of your choice:

npm install conformal

Here's a quick example showing how Conformal handles form validation with a user registration form:

import { parseFormData } from "conformal";
import * as z from "zod";

// Tip: Use conformal's coerce functions for form input preprocessing
const schema = z.object({
  name: z.string().min(2, "Name must be at least 2 characters"),
  email: z.email("Invalid email address"),
  age: z.coerce.number().min(18, "Must be at least 18 years old"),
  acceptTerms: z.coerce.boolean(),
});

// In your form action or handler
const result = parseFormData(schema, formData);
const submission = result.submission();

if (submission.status === "success") {
  // submission.value is fully typed: { name: string, email: string, age: number, acceptTerms: boolean }
  console.log("User registered:", submission.value);
} else {
  // submission.fieldErrors contains validation errors: { email: ["Invalid email address"] }
  console.log("Validation errors:", submission.fieldErrors);
  // submission.input preserves the raw user input for re-display
  console.log("User input:", submission.input);
}

That's it! Conformal automatically handles FormData parsing, type coercion, and provides a clean submission interface.

Live Examples

API Reference

Functions

  • parseFormData - Parse FormData with schema validation and get Submission object
  • decode - Convert FormData to structured objects (no validation)
  • serialize - Transform typed values back to form-compatible strings
  • getPath - Safely access nested values using dot/bracket notation
  • setPath - Immutably set nested values using dot/bracket notation
  • coerceX - A set of coercion functions for use with schema libraries

Types

  • Submission - Standardized submission result with success/error states
  • PathsFromObject - Type utility to extract all possible object paths

Valibot Utilities

⚠️ Experimental: These utilities are still in development and may change.

License

Conformal is licensed under the MIT License.