@tus/server@2.0.0
·
33 commits
to main
since this release
Major Changes
- 0f063d9: Change required Node.js version from 16 to 20.19.0
- 51419da: - Introduce
handleWeb(req: Request)to integrate into meta frameworks
(such as Next.js, Nuxt, React Router, SvelteKit, etc) and other Node.js compatible runtime environments.- All events and hooks now emit
Request/Responseinstead ofhttp.IncomingMessage/http.ServerResponse. - The function version of the options
maxSize,generateUrl,getFileIdFromRequest,namingFunction,locker
also now useRequest/Response. - Your
onUploadCreateandonUploadFinishhooks no longer need to return the response object.- If you want to change the metadata in
onUploadCreateyou can returnPromise<{ metadata: Record<string, string> }>.
This will will internally merge the existing metadata with the new metadata. onUploadFinishcan returnPromise<{ status_code?: number headers?: Record<string, string | number> body?: string }>
- If you want to change the metadata in
- All events and hooks now emit
- f190875: -
POST_RECEIVE_V2has been renamed toPOST_RECEIVE. The deprecated version ofPOST_RECEIVEhas been removed. - 7a5a60d: Make this package ESM-only instead of CommonJS. Since Node.js >= 20.19.0 you can
require(esm)so you can consume this package even if you don't ESM yourself yet.