Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Benchmark (Mean time for 500 Kb payload, 2000 cycles, 1000 cycle warmup):
| busboy | 0.3.1 | `340114` |
| @fastify/busboy | 1.0.0 | `270984` |

[Changelog](https://github.com/fastify/busboy/blob/main/CHANGELOG.md) since busboy 0.31.

Requirements
============

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/busboy/contestants/fastify-busboy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Busboy = require('../../../lib/main')
const Busboy = require('../../../index')
const { buffer, boundary } = require('../data')

function process () {
Expand Down
8 changes: 4 additions & 4 deletions lib/main.js → index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

const WritableStream = require('node:stream').Writable
const { inherits } = require('node:util')
const Dicer = require('../deps/dicer/lib/Dicer')
const Dicer = require('./deps/dicer/lib/Dicer')

const MultipartParser = require('./types/multipart')
const UrlencodedParser = require('./types/urlencoded')
const parseParams = require('./utils/parseParams')
const MultipartParser = require('./lib/types/multipart')
const UrlencodedParser = require('./lib/types/urlencoded')
const parseParams = require('./lib/utils/parseParams')

function Busboy (opts) {
if (!(this instanceof Busboy)) { return new Busboy(opts) }
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
}
],
"description": "A streaming parser for HTML form data for node.js",
"main": "lib/main",
"main": "index.js",
"type": "commonjs",
"types": "lib/main.d.ts",
"types": "types/index.d.ts",
"scripts": {
"bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify",
"bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js",
"coveralls": "nyc report --reporter=lcov",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test:unit": "c8 --statements 98 --branches 97 --functions 96 --lines 98 node --test",
"test:types": "tsd",
"test:types": "tstyche",
"test": "npm run test:unit && npm run test:types"
},
"devDependencies": {
Expand All @@ -38,7 +38,7 @@
"eslint": "^9.39.0",
"neostandard": "^0.12.0",
"tinybench": "^6.0.0",
"tsd": "^0.33.0",
"tstyche": "^7.0.0",
"tslib": "^2.8.1",
"typescript": "~6.0.2"
},
Expand All @@ -57,9 +57,6 @@
"url": "https://github.com/fastify/busboy/issues"
},
"homepage": "https://github.com/fastify/busboy#readme",
"tsd": {
"directory": "test-types"
},
"standard": {
"globals": [
"describe",
Expand All @@ -72,10 +69,12 @@
"files": [
"README.md",
"LICENSE",
"index.js",
"lib/*",
"types/*",
"deps/encoding/*",
"deps/dicer/lib",
"deps/streamsearch/",
"deps/dicer/LICENSE"
]
}
}
236 changes: 0 additions & 236 deletions test-types/main.test-d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/busboy-constructor.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Busboy = require('../lib/main')
const Busboy = require('..')
const { test } = require('node:test')

test('busboy-constructor - should throw an Error if no options are provided', t => {
Expand Down
2 changes: 1 addition & 1 deletion test/busboy-emit.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Busboy = require('../lib/main')
const Busboy = require('..')
const { test } = require('node:test')

test('busboy, emit', t => {
Expand Down
2 changes: 1 addition & 1 deletion test/dicer-export.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const { Dicer } = require('../lib/main')
const { Dicer } = require('..')

test('dicer-export', async t => {
t.plan(2)
Expand Down
2 changes: 1 addition & 1 deletion test/dicer-write.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const { Dicer } = require('../lib/main')
const { Dicer } = require('..')

test('dicer _write method', t => {
t.plan(1)
Expand Down
2 changes: 1 addition & 1 deletion test/multipart-constructor.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const Multipart = require('../lib/types/multipart')
const Busboy = require('../lib/main')
const Busboy = require('..')
const { test } = require('node:test')

test('multipart constructor', t => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
"module": "Node16",
"target": "es2022",
"sourceMap": false,
Expand All @@ -17,7 +18,6 @@
"noImplicitThis": true,
"strictNullChecks": true,
"importHelpers": true,
"baseUrl": ".",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
Expand Down
3 changes: 2 additions & 1 deletion test-types/dicer.test-d.ts → types/dicer.tst.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Dicer } from '../lib/main'
import { Dicer } from '.'
import * as fs from 'fs'
import * as stream from 'stream'

Expand All @@ -17,6 +17,7 @@ function testDicerSyntax () {
headerFirst: false,
maxHeaderPairs: 8,
}

dicer.setBoundary('new-testing-boundary')
dicer.on('part', handleDicerPartStream)
dicer.on('finish', () => {
Expand Down
File renamed without changes.
Loading
Loading