NuxtParter
NuxtParter is a utility class for handling HTTP events in a Nuxt.js application. It can parse both multipart form data and regular body data from HTTP requests. It also provides a static method for storing files.
Installation
npm install --save nitro-parter
import { NuxtParter } from 'nitro-parter';
Create a new instance of NuxtParter with the HTTP event you want to handle
let {data, files} = await NuxtParter.readRequestData(event);
data
and files
properties of the NuxtParter
instance
Access the parsed data and files from the event.context.files = files;
event.context.data = data;
storeFile
method to store a file to a specified path
Use the static NuxtParter.storeFile(file, path);