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

@open-form/core

v0.1.3

Published

Core package for OpenForm framework - schemas, builders, validation, and serialization utilities

Readme

OpenForm documentation Follow on Twitter

OpenForm is documents as code. It lets developers and AI agents define, validate, and render business documents using typed, composable schemas. This eliminates template drift, broken mappings, and brittle glue code — while giving AI systems a reliable document layer they can safely read, reason over, and generate against in production workflows.

Package overview

Fundamental package for modeling business documents as typed, versioned artifacts. Provides builders for Forms, Documents, Checklists, and Bundles with schema-driven validation and composition.

  • 🏗️ Type-safe builders - Fluent API for defining document structures
  • 📋 Four artifact types - Form, Document, Checklist, and Bundle builders
  • Schema-driven validation - Built-in structure and constraint validation
  • 🎯 Composable design - Reuse fields and artifacts across definitions
  • 📦 Standalone library - Use independently or with @open-form/sdk

Installation

npm install @open-form/core

Usage

Define forms with parties, fields, and validation rules:

import { open } from "@open-form/core";

const leaseAgreement = open
  .form()
  .name("residential-lease-agreement")
  .version("1.0.0")
  .title("Residential Lease Agreement")
  .defaultLayer("markdown")
  .layers({
    markdown: open
      .layer()
      .file()
      .mimeType("text/markdown")
      .path("fixtures/lease-agreement.md"),
  })
  .parties({
    landlord: open
      .party()
      .label("Landlord")
      .signature((sig) => sig.required()),
    tenant: open
      .party()
      .label("Tenant")
      .multiple(true)
      .min(1)
      .max(4)
      .signature((sig) => sig.required()),
  })
  .fields({
    leaseId: { type: "uuid", label: "Lease ID" },
    propertyAddress: {
      type: "address",
      label: "Property Address",
      required: true,
    },
    monthlyRent: { type: "money", label: "Monthly Rent", required: true },
    leaseStartDate: { type: "date", label: "Lease Start Date", required: true },
  })
  .build();

Add file attachments and advanced field types:

const advancedLease = open
  .form()
  .name("commercial-lease")
  .version("1.0.0")
  .title("Commercial Lease Agreement")
  .allowAnnexes(true)
  .annexes([
    open.annex().id("photoId").title("Photo ID").required(true),
    open.annex().id("proofOfIncome").title("Proof of Income").required(true),
  ])
  .parties({
    landlord: open
      .party()
      .label("Landlord")
      .signature((sig) => sig.required()),
    tenant: open
      .party()
      .label("Tenant")
      .multiple(true)
      .signature((sig) => sig.required()),
  })
  .fields({
    leaseId: { type: "uuid", label: "Lease ID", required: true },
    leaseTermMonths: {
      type: "number",
      label: "Lease Term (months)",
      required: true,
    },
    monthlyRent: { type: "money", label: "Monthly Rent", required: true },
    petPolicy: {
      type: "enum",
      enum: ["no-pets", "small-pets", "all-pets"],
      label: "Pet Policy",
      required: true,
    },
  })
  .build();

Define static documents with metadata:

const leadPaintDisclosure = open
  .document()
  .name("lead-paint-disclosure")
  .version("1.0.0")
  .title("Lead Paint Disclosure")
  .code("EPA-747-K-12-001")
  .releaseDate("2025-12-01")
  .metadata({ agency: "EPA/HUD", cfr: "40 CFR 745" })
  .layers({
    pdf: open
      .layer()
      .file()
      .path("fixtures/lead-paint-disclosure.pdf")
      .mimeType("application/pdf"),
  })
  .defaultLayer("pdf")
  .build();

Define workflow checklists with status tracking:

const leaseChecklist = open
  .checklist()
  .name("lease-application-checklist")
  .version("1.0.0")
  .title("Lease Application Checklist")
  .items([
    {
      id: "application_received",
      title: "Application Received",
      status: { kind: "boolean" },
    },
    {
      id: "credit_check",
      title: "Credit Check Complete",
      status: { kind: "boolean" },
    },
    {
      id: "background_check",
      title: "Background Check Complete",
      status: { kind: "boolean" },
    },
    { id: "lease_signed", title: "Lease Signed", status: { kind: "boolean" } },
  ])
  .build();

Compose artifacts into bundles:

const propertyAddress = {
  type: "address",
  label: "Property Address",
  required: true,
};
const monthlyRent = { type: "money", label: "Monthly Rent", required: true };

const residentialLease = open
  .form()
  .name("residential-lease")
  .version("1.0.0")
  .fields({ leaseId: { type: "uuid" }, propertyAddress, monthlyRent })
  .build();

const commercialLease = open
  .form()
  .name("commercial-lease")
  .version("1.0.0")
  .fields({ leaseId: { type: "uuid" }, propertyAddress, monthlyRent })
  .build();

const leaseBundle = open
  .bundle()
  .name("residential-lease-bundle")
  .version("1.0.0")
  .contents([
    { type: "inline", key: "residential", artifact: residentialLease.schema },
    { type: "inline", key: "commercial", artifact: commercialLease.schema },
    { type: "inline", key: "disclosure", artifact: leadPaintDisclosure.schema },
    { type: "inline", key: "checklist", artifact: leaseChecklist.schema },
  ])
  .build();

Extract TypeScript types from artifacts:

import { type InferFormData } from "@open-form/core";

type LeaseData = InferFormData<typeof leaseAgreement>;

const data: LeaseData = {
  leaseId: "550e8400-e29b-41d4-a716-446655440000",
  propertyAddress: {
    line1: "123 Main St",
    locality: "Portland",
    region: "OR",
    postalCode: "97201",
    country: "USA",
  },
  monthlyRent: { amount: 1500, currency: "USD" },
  leaseStartDate: new Date("2024-02-01"),
};

Validate data against form schemas:

if (!leaseAgreement.isValid(data)) {
  console.log("Data does not match form schema");
}

try {
  const filled = leaseAgreement.fill(data);
} catch (error) {
  console.error("Validation failed:", error);
}

For rendering artifacts to PDF, DOCX, HTML, or other formats, use @open-form/sdk with the renderers package. For complete production examples, see /incubator/apps/demo/src/demos/leasing. For API reference and advanced patterns, visit docs.open-form.dev.

Changelog

View the Changelog for updates.

Related packages

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines and code of conduct.

License

This project is licensed under the MIT license.

See LICENSE for more information.