Fresh Validation

screenshot of Fresh Validation
fresh

Easy server-side and client-side validation for FormData, URLSearchParams and JSON data in your Fresh app

Overview

Fresh Validation is a powerful tool designed for validating data in your Fresh applications, whether you're working server-side or client-side. Built on top of Zod, it streamlines the process of ensuring that your data is not only present but also correctly typed and formatted. With Fresh Validation, you can easily handle input validation for various data types like FormData, URLSearchParams, and JSON, making it an essential component for developers seeking robustness in their applications.

Whether you are new to data validation or looking to enhance your existing setup, Fresh Validation offers a straightforward approach that allows you to validate data seamlessly. Its compatibility with common web data types ensures that you can maintain data integrity effortlessly throughout your app.

Features

  • Seamless Integration: Use Fresh Validation directly without any additional setup, making it easy to implement in existing projects.
  • FormData Validation: Validate and cast FormData to the correct data type automatically, overcoming the limitation of losing data typing during transmission.
  • URLSearchParams Support: Validate URLSearchParams in the same way you would with FormData, ensuring consistency across different data types.
  • Robust JSON Validation: Extract JSON data requests and validate them against a Zod schema, ensuring your data conforms to expected structures.
  • Date Transformation: Automatically transform any date strings into Date instances for simplified validation, allowing for more accurate data handling.
  • Zod Compatibility: Leverage the rich validation rules and schema definitions available in Zod for comprehensive data validation options.
  • Client and Server-Side Flexibility: Use Fresh Validation in both client-side and server-side applications for versatile data validation capabilities.
fresh
Fresh

Fresh is a full stack modern web framework for JavaScript and TypeScript developers, designed to make it trivial to create high-quality, performant, and personalized web applications. You can use it to create your home page, a blog, a large web application like GitHub or Twitter, or anything else you can think of. At its core, Fresh is a combination of a routing framework and templating engine that renders pages on demand, on the server