{"_id":"nestjs-busboy","_rev":"3-9748c5181a332092ef4f8f648a032a9e","name":"nestjs-busboy","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"nestjs-busboy","version":"1.0.0","keywords":["fastify","express","nestjs","file upload","busboy","multipart"],"author":{"name":"DrRaider"},"license":"MIT","_id":"nestjs-busboy@1.0.0","maintainers":[{"name":"dr_raider","email":"nsailly@live.fr"}],"contributors":[{"name":"Nicolas SAILLY"}],"homepage":"https://github.com/DrRaider/nestjs-busboy#readme","bugs":{"url":"https://github.com/DrRaider/nestjs-busboy/issues"},"dist":{"shasum":"ec12f17d65e77053765dbf99111b781a7bc799fd","tarball":"https://registry.npmjs.org/nestjs-busboy/-/nestjs-busboy-1.0.0.tgz","fileCount":66,"integrity":"sha512-dXfCS++laA9gbPTxJdYxl4HiNcJ3AsZQncI9zTlh4T6LWH+7+19IZW7TXBZjBsFaz9Nii8SlDfvgUWBEFffdUQ==","signatures":[{"sig":"MEUCIA/wGSlL2SgPYYTvBDzb3CgonQFPd+JSpZ5cp1U/IreEAiEAk/5fYRC1K+fx/eKerwc0F0kTmt0h8yIjmAbmGm8gSxA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60165},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js"}},"gitHead":"a91c35a131800b5eb7023555c304434073c64e3f","scripts":{"test":"jest --runInBand","build":"tsc -p tsconfig.build.json","check":"biome check .","prepare":"lefthook install","check:fix":"biome check --write .","typecheck":"tsc --noEmit && tsc --noEmit -p tsconfig.build.json","preinstall":"npx only-allow pnpm","prepublishOnly":"pnpm build"},"_npmUser":{"name":"dr_raider","email":"nsailly@live.fr"},"repository":{"url":"git+https://github.com/DrRaider/nestjs-busboy.git","type":"git"},"_npmVersion":"11.6.2","description":"A File Upload package for NestJS supporting both Fastify and Express adapters","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@fastify/busboy":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.10.0","devDependencies":{"jest":"^29.7.0","rxjs":"^7.8.1","tslib":"^2.6.0","pactum":"^3.7.0","lefthook":"^1.11.0","@swc/core":"^1.4.0","@swc/jest":"^0.2.37","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@nestjs/core":"^10.0.0","@biomejs/biome":"^2.0.0","@nestjs/common":"^10.0.0","@changesets/cli":"^2.29.0","@nestjs/testing":"^10.0.0","reflect-metadata":"^0.2.0","@nestjs/platform-express":"^10.0.0","@nestjs/platform-fastify":"^10.0.0"},"peerDependencies":{"rxjs":"^7.0.0","@nestjs/common":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-express":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-fastify":"^9.0.0 || ^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"rxjs":{"optional":false},"@nestjs/common":{"optional":false},"@nestjs/platform-express":{"optional":true},"@nestjs/platform-fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nestjs-busboy_1.0.0_1774441446270_0.554073132659372","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"nestjs-busboy","version":"1.0.1","keywords":["fastify","express","nestjs","file upload","busboy","multipart"],"author":{"name":"DrRaider"},"license":"MIT","_id":"nestjs-busboy@1.0.1","maintainers":[{"name":"dr_raider","email":"nsailly@live.fr"}],"contributors":[{"name":"Nicolas SAILLY"}],"homepage":"https://github.com/DrRaider/nestjs-busboy#readme","bugs":{"url":"https://github.com/DrRaider/nestjs-busboy/issues"},"dist":{"shasum":"7abe31c32e9ce05ddbcd11eceeafb21524948ad9","tarball":"https://registry.npmjs.org/nestjs-busboy/-/nestjs-busboy-1.0.1.tgz","fileCount":66,"integrity":"sha512-ucheC0WowLue1SqWJ8QfSzqCvx0hURRzlhghNNVubaw0STlLFndEyxbHmhQYa5FL9URtiiVx4xBJouIxhV07zw==","signatures":[{"sig":"MEYCIQD6gsYxBD1BNTsn20ZqG6AS7jNiQHdjEeK75UJ4n6/EBAIhAN/ns75bYP4mDZTT8y1hfzgkxEU/ASDte5O2y2ZiV/g2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60659},"main":"dist/index.js","type":"commonjs","_from":"file:nestjs-busboy-1.0.1.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js"}},"scripts":{"test":"jest --runInBand","build":"tsc -p tsconfig.build.json","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit && tsc --noEmit -p tsconfig.build.json","preinstall":"npx only-allow pnpm"},"_npmUser":{"name":"dr_raider","email":"nsailly@live.fr"},"_resolved":"/tmp/a221330ac2e14328ece7fc24fb1d6fae/nestjs-busboy-1.0.1.tgz","_integrity":"sha512-ucheC0WowLue1SqWJ8QfSzqCvx0hURRzlhghNNVubaw0STlLFndEyxbHmhQYa5FL9URtiiVx4xBJouIxhV07zw==","repository":{"url":"git+https://github.com/DrRaider/nestjs-busboy.git","type":"git"},"_npmVersion":"10.8.2","description":"A File Upload package for NestJS supporting both Fastify and Express adapters","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@fastify/busboy":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","rxjs":"^7.8.1","tslib":"^2.6.0","pactum":"^3.7.0","lefthook":"^2.1.4","@swc/core":"^1.4.0","@swc/jest":"^0.2.37","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^25.5.0","@nestjs/core":"^11.1.17","@biomejs/biome":"^2.0.0","@nestjs/common":"^11.1.17","@changesets/cli":"^2.29.0","@nestjs/testing":"^11.1.17","reflect-metadata":"^0.2.0","@nestjs/platform-express":"^11.1.17","@nestjs/platform-fastify":"^11.1.17"},"peerDependencies":{"rxjs":"^7.0.0","@nestjs/common":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-express":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-fastify":"^9.0.0 || ^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"rxjs":{"optional":false},"@nestjs/common":{"optional":false},"@nestjs/platform-express":{"optional":true},"@nestjs/platform-fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nestjs-busboy_1.0.1_1775664112427_0.736496400856091","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"nestjs-busboy@1.0.2","bugs":{"url":"https://github.com/DrRaider/nestjs-busboy/issues"},"dist":{"shasum":"a03ac97e0f399380f55176953ebf76f01822ade3","tarball":"https://registry.npmjs.org/nestjs-busboy/-/nestjs-busboy-1.0.2.tgz","fileCount":66,"integrity":"sha512-YIXcHyPMYECmt4N3mA69c/DzN3hfdXNzNmR7HTH1ei7N+7VUfypGv0iiRS5MR4+MVgD9DKNLRQ0LYEBXG3dRLg==","signatures":[{"sig":"MEUCIQCyv0wHYtJ9iDpGxfM21YzSbOh0XwYzJQind6/tZDFtFAIgVf6w2aA4iU/K2LmeBfAW/7yNese539ANAXqgdohGym4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEzvP4qzpbzvp3JKKn2gLqAxqZMPATGTWeOBgf5Sa+6QAiAuO9Wt0BECaMRixXM4SutIFfv7cklr8mAlZd1AVpQbSg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/nestjs-busboy@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":60659},"main":"dist/index.js","name":"nestjs-busboy","type":"commonjs","_from":"file:nestjs-busboy-1.0.2.tgz","types":"dist/index.d.ts","author":{"name":"DrRaider"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js"}},"license":"MIT","scripts":{"test":"jest --runInBand","build":"tsc -p tsconfig.build.json","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit && tsc --noEmit -p tsconfig.build.json","preinstall":"npx only-allow pnpm"},"version":"1.0.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:97e801d8-2f7f-4ea9-afef-5959f6077c95"}},"homepage":"https://github.com/DrRaider/nestjs-busboy#readme","keywords":["fastify","express","nestjs","file upload","busboy","multipart"],"_resolved":"/tmp/8302c944875a530d3c7d4c9f220f8ab5/nestjs-busboy-1.0.2.tgz","_integrity":"sha512-YIXcHyPMYECmt4N3mA69c/DzN3hfdXNzNmR7HTH1ei7N+7VUfypGv0iiRS5MR4+MVgD9DKNLRQ0LYEBXG3dRLg==","repository":{"url":"git+https://github.com/DrRaider/nestjs-busboy.git","type":"git"},"_npmVersion":"11.19.0","description":"A File Upload package for NestJS supporting both Fastify and Express adapters","directories":{},"maintainers":[{"name":"dr_raider","email":"nsailly@live.fr"}],"_nodeVersion":"24.20.0","contributors":[{"name":"Nicolas SAILLY"}],"dependencies":{"@fastify/busboy":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","rxjs":"^7.8.1","tslib":"^2.6.0","pactum":"^3.7.0","lefthook":"^2.1.4","@swc/core":"^1.4.0","@swc/jest":"^0.2.37","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^25.5.0","@nestjs/core":"^11.1.17","@biomejs/biome":"^2.0.0","@nestjs/common":"^11.1.17","@changesets/cli":"^2.29.0","@nestjs/testing":"^11.1.17","reflect-metadata":"^0.2.0","@nestjs/platform-express":"^11.1.17","@nestjs/platform-fastify":"^11.1.17"},"peerDependencies":{"rxjs":"^7.0.0","@nestjs/common":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-express":"^9.0.0 || ^10.0.0 || ^11.0.0","@nestjs/platform-fastify":"^9.0.0 || ^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"rxjs":{"optional":false},"@nestjs/common":{"optional":false},"@nestjs/platform-express":{"optional":true},"@nestjs/platform-fastify":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-busboy_1.0.2_1789732840514_0.9326320683862395"}}},"time":{"created":"2026-03-25T12:24:06.185Z","modified":"2026-09-18T12:00:41.120Z","1.0.0":"2026-03-25T12:24:06.405Z","1.0.1":"2026-04-08T16:01:52.580Z","1.0.2":"2026-09-18T12:00:40.603Z"},"bugs":{"url":"https://github.com/DrRaider/nestjs-busboy/issues"},"author":{"name":"DrRaider"},"license":"MIT","homepage":"https://github.com/DrRaider/nestjs-busboy#readme","keywords":["fastify","express","nestjs","file upload","busboy","multipart"],"repository":{"url":"git+https://github.com/DrRaider/nestjs-busboy.git","type":"git"},"description":"A File Upload package for NestJS supporting both Fastify and Express adapters","contributors":[{"name":"Nicolas SAILLY"}],"maintainers":[{"name":"dr_raider","email":"nsailly@live.fr"}],"readme":"# nestjs-busboy\n\nFile upload support for NestJS that works with **both** the Fastify and Express adapters, built directly on [`@fastify/busboy`](https://github.com/fastify/busboy) (the underlying multipart parser).\n\nThis package replaces `@nest-lab/fastify-multer`, which depends on the unmaintained `fastify-multer` library and does not support Fastify v5.\n\n## Installation\n\n```shell\nnpm i nestjs-busboy\nyarn add nestjs-busboy\npnpm i nestjs-busboy\n```\n\n## Usage\n\nUse this exactly like you would the [`MulterModule`](https://docs.nestjs.com/techniques/file-upload) from `@nestjs/platform-express`. The same interceptors, storage engines, and options are supported.\n\nYou **must** import `BusboyModule` somewhere in your application so that the `multipart/form-data` content-type parser is registered with Fastify (on Express this step is a no-op).\n\n### Basic setup\n\n```typescript\nimport { BusboyModule } from 'nestjs-busboy';\n\n@Module({\n  imports: [BusboyModule],\n})\nexport class AppModule {}\n```\n\n### Module-level options\n\n```typescript\nimport { BusboyModule, memoryStorage } from 'nestjs-busboy';\n\n@Module({\n  imports: [\n    BusboyModule.register({\n      storage: memoryStorage(),\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Async options\n\n```typescript\n@Module({\n  imports: [\n    BusboyModule.registerAsync({\n      useFactory: (config: ConfigService) => ({\n        dest: config.get('UPLOAD_DIR'),\n      }),\n      inject: [ConfigService],\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Interceptors\n\nAll interceptors accept an optional `localOptions` argument that is merged with module-level options.\n\n```typescript\nimport {\n  AnyFilesInterceptor,\n  FileFieldsInterceptor,\n  FileInterceptor,\n  FilesInterceptor,\n  NoFilesInterceptor,\n  memoryStorage,\n} from 'nestjs-busboy';\n\n@Controller('upload')\nexport class UploadController {\n  // Single file from field \"file\"\n  @Post('single')\n  @UseInterceptors(FileInterceptor('file', { storage: memoryStorage() }))\n  uploadSingle(@UploadedFile() file: Express.Multer.File) { ... }\n\n  // Up to 10 files from field \"files\"\n  @Post('multiple')\n  @UseInterceptors(FilesInterceptor('files', 10, { storage: memoryStorage() }))\n  uploadMultiple(@UploadedFiles() files: Express.Multer.File[]) { ... }\n\n  // Any files from any field\n  @Post('any')\n  @UseInterceptors(AnyFilesInterceptor({ storage: memoryStorage() }))\n  uploadAny(@UploadedFiles() files: Express.Multer.File[]) { ... }\n\n  // Named fields\n  @Post('fields')\n  @UseInterceptors(\n    FileFieldsInterceptor([{ name: 'avatar' }, { name: 'cover', maxCount: 1 }], {\n      storage: memoryStorage(),\n    }),\n  )\n  uploadFields(@UploadedFiles() files: { avatar?: Express.Multer.File[]; cover?: Express.Multer.File[] }) { ... }\n\n  // No files allowed — parses form fields only\n  @Post('form')\n  @UseInterceptors(NoFilesInterceptor())\n  formData(@Body() body: Record<string, string>) { ... }\n}\n```\n\n### Storage engines\n\n#### Memory storage (default)\n\nFiles are buffered in memory as `Buffer` objects. This is the default when neither `storage` nor `dest` is specified.\n\n```typescript\nimport { memoryStorage } from 'nestjs-busboy';\n\nFileInterceptor('file', { storage: memoryStorage() })\n```\n\n#### Disk storage\n\nFiles are written to disk. The destination directory is created automatically.\n\n```typescript\nimport { diskStorage } from 'nestjs-busboy';\n\nFileInterceptor('file', {\n  storage: diskStorage({\n    destination: '/uploads',\n    filename: (req, file, cb) => cb(null, `${Date.now()}-${file.originalname}`),\n  }),\n})\n```\n\nOr use the `dest` shorthand (generates random filenames):\n\n```typescript\nBusboyModule.register({ dest: '/uploads' })\n```\n\n### Options\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `storage` | `StorageEngine` | Custom storage engine. Defaults to `MemoryStorage`. |\n| `dest` | `string` | Destination directory. Uses `DiskStorage` with random filenames. |\n| `fileFilter` | `FileFilter` | Function to control which files are accepted. |\n| `limits` | `BusboyLimits` | Limits on incoming data (file size, file count, etc.). |\n| `preservePath` | `boolean` | Preserve the full path of the original filename. |\n\n## Migrating from `@nest-lab/fastify-multer`\n\n1. Replace `@nest-lab/fastify-multer` with `nestjs-busboy` in your dependencies.\n2. Replace `FastifyMulterModule` with `BusboyModule` in your imports.\n3. Replace `memoryStorage` / `diskStorage` imports — they now come from `nestjs-busboy` directly instead of `fastify-multer/lib`.\n\n```diff\n-import { FastifyMulterModule } from '@nest-lab/fastify-multer';\n-import { memoryStorage } from 'fastify-multer/lib';\n+import { BusboyModule, memoryStorage } from 'nestjs-busboy';\n\n-FastifyMulterModule.register({ ... })\n+BusboyModule.register({ ... })\n```\n\nAll interceptor names and options are identical.\n","readmeFilename":"README.md"}