New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@webundsoehne/nest-fastify-file-upload

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webundsoehne/nest-fastify-file-upload

Port of NestJS file upload module for fastify adapter

  • 2.0.0
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Web und Söhne - Logo

Web & Söhne is Austria's leading expert in programming and implementing complex and large web projects.

Port from Nest's File Upload for Fastify Adapter!

  • IMPORTANT: when initializing Fastify Adapter you have to register fastify-multer as well.

Steps:

Install to your project:

npm i @webundsoehne/nest-fastify-file-upload

Add contentParser to your root application on creation:

import { NestFactory } from '@nestjs/core'
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { contentParser } from 'fastify-multer'

import { AppModule } from './app.module'

async function bootstrap (): Promise<void> {
  const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter())

  await app.register(contentParser)

  await app.listen(3000)
}

bootstrap()

Use it like the official NestJS package for Express in your controllers:

@Post('upload')
@UseInterceptors(FileInterceptor('file'))
@ApiFileBody('file')
@ApiConsumes('multipart/form-data')
uploadFile (@UploadedFile('file') file: MulterFile): void {
    console.log(file)
}

...

The package will export the missing Express.Multer.* types as Multer*.

Stay in touch

Keywords

FAQs

Package last updated on 13 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc