@fastify/send
Advanced tools
Comparing version 2.1.0 to 3.0.0-pre.fv5.1
'use strict' | ||
const http = require('http') | ||
const http = require('node:http') | ||
const send = require('..') | ||
const path = require('path') | ||
const path = require('node:path') | ||
@@ -7,0 +7,0 @@ const indexPath = path.join(__dirname, 'index.html') |
@@ -22,4 +22,5 @@ 'use strict' | ||
} | ||
/* c8 ignore next */ | ||
} | ||
module.exports.collapseLeadingSlashes = collapseLeadingSlashes |
@@ -419,4 +419,4 @@ /*! | ||
// POSIX throws ENAMETOOLONG and ENOTDIR, Windows only ENOENT | ||
/* istanbul ignore next */ | ||
switch (error.code) { | ||
/* c8 ignore start */ | ||
case 'ENAMETOOLONG': | ||
@@ -427,2 +427,3 @@ case 'ENOTDIR': | ||
break | ||
/* c8 ignore stop */ | ||
default: | ||
@@ -575,6 +576,7 @@ this.error(500, error) | ||
switch (this._dotfiles) { | ||
/* istanbul ignore next: unreachable, because NODE_DEBUG can not be set after process is running */ | ||
/* c8 ignore start */ /* unreachable, because NODE_DEBUG can not be set after process is running */ | ||
case 0: // 'allow' | ||
debug('allow dotfile "%s"', path) | ||
break | ||
/* c8 ignore stop */ | ||
case 2: // 'deny' | ||
@@ -581,0 +583,0 @@ debug('deny dotfile "%s"', path) |
{ | ||
"name": "@fastify/send", | ||
"description": "Better streaming static file server with Range and conditional-GET support", | ||
"version": "2.1.0", | ||
"version": "3.0.0-pre.fv5.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -12,2 +12,3 @@ "contributors": [ | ||
"main": "index.js", | ||
"type": "commonjs", | ||
"types": "types/index.d.ts", | ||
@@ -28,15 +29,15 @@ "license": "MIT", | ||
"http-errors": "2.0.0", | ||
"mime": "^3.0.0", | ||
"@lukeed/ms": "^2.0.1" | ||
"mime": "^3", | ||
"@lukeed/ms": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@fastify/pre-commit": "^2.0.2", | ||
"@types/node": "^18.11.18", | ||
"@fastify/pre-commit": "^2.1.0", | ||
"@types/node": "^20.12.2", | ||
"after": "0.8.2", | ||
"benchmark": "^2.1.4", | ||
"snazzy": "^9.0.0", | ||
"standard": "^17.0.0", | ||
"supertest": "6.3.3", | ||
"tap": "^16.3.3", | ||
"tsd": "^0.28.0" | ||
"standard": "^17.1.0", | ||
"supertest": "6.3.4", | ||
"tap": "^18.7.2", | ||
"tsd": "^0.31.0" | ||
}, | ||
@@ -43,0 +44,0 @@ "scripts": { |
@@ -23,2 +23,11 @@ # @fastify/send | ||
### TypeScript | ||
`@types/mime@3` must be used if wanting to use TypeScript; | ||
`@types/mime@4` removed the `mime` types. | ||
```bash | ||
$ npm install -D @types/mime@3 | ||
``` | ||
## API | ||
@@ -177,3 +186,3 @@ | ||
```js | ||
var http = require('http') | ||
var http = require('node:http') | ||
var send = require('send') | ||
@@ -196,3 +205,3 @@ | ||
```js | ||
var http = require('http') | ||
var http = require('node:http') | ||
var parseUrl = require('parseurl') | ||
@@ -212,3 +221,3 @@ var send = require('@fastify/send') | ||
```js | ||
var http = require('http') | ||
var http = require('node:http') | ||
var parseUrl = require('parseurl') | ||
@@ -239,4 +248,4 @@ var send = require('@fastify/send') | ||
```js | ||
var http = require('http') | ||
var fs = require('fs') | ||
var http = require('node:http') | ||
var fs = require('node:fs') | ||
var parseUrl = require('parseurl') | ||
@@ -278,3 +287,3 @@ var send = require('@fastify/send') | ||
```js | ||
var http = require('http') | ||
var http = require('node:http') | ||
var parseUrl = require('parseurl') | ||
@@ -281,0 +290,0 @@ var send = require('@fastify/send') |
'use strict' | ||
const { test } = require('tap') | ||
const path = require('path') | ||
const path = require('node:path') | ||
const request = require('supertest') | ||
@@ -22,7 +22,7 @@ const send = require('..') | ||
t.before(function () { | ||
t.before(() => { | ||
this.default_type = send.mime.default_type | ||
}) | ||
t.afterEach(function () { | ||
t.afterEach(() => { | ||
send.mime.default_type = this.default_type | ||
@@ -29,0 +29,0 @@ }) |
@@ -5,7 +5,7 @@ 'use strict' | ||
const after = require('after') | ||
const http = require('http') | ||
const path = require('path') | ||
const http = require('node:http') | ||
const path = require('node:path') | ||
const request = require('supertest') | ||
const SendStream = require('../lib/SendStream') | ||
const os = require('os') | ||
const os = require('node:os') | ||
const { shouldNotHaveBody, createServer, shouldNotHaveHeader } = require('./utils') | ||
@@ -12,0 +12,0 @@ |
'use strict' | ||
const { test } = require('tap') | ||
const fs = require('fs') | ||
const http = require('http') | ||
const path = require('path') | ||
const fs = require('node:fs') | ||
const http = require('node:http') | ||
const path = require('node:path') | ||
const request = require('supertest') | ||
@@ -8,0 +8,0 @@ const SendStream = require('..').SendStream |
'use strict' | ||
const http = require('http') | ||
const http = require('node:http') | ||
const send = require('..') | ||
@@ -5,0 +5,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
139545
58
3486
321
0
2
2
Updated@lukeed/ms@^2.0.2
Updatedmime@^3