nuxt-parse is an open source Nuxt 3 focused package to make data validation and parsing easy. This package follows the design philosophy of the article parse, don't validate. It uses zod for parsing data from the user, APIs or your own functions.

  • Validate Data using zod
  • Deserialize and Serialize user, backend, api data
  • Helpers focused on Nuxt 3 usage and developer experience

Show me the code!

nuxt-parse exports the following functions:

parseBodyAsParse body of h3 event
parseParamsAsParse params of h3 event
parseQueryAsParse query of h3 event
parseCookieAsParse cookies of h3 event
parseHeaderAsParse header of h3 event
parseDataAsParse sync or async data
makeParserMake your own parser (see example here)
zzod, the library used for parsing