koa-files 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{Send.js → Send.cjs} +10 -1
- package/cjs/{index.js → index.cjs} +10 -1
- package/cjs/{utils.js → utils.cjs} +9 -0
- package/esm/Send.js +9 -0
- package/esm/index.js +9 -0
- package/esm/utils.js +9 -0
- package/package.json +19 -14
- /package/{typings → types}/Send.d.ts +0 -0
- /package/{typings → types}/index.d.ts +0 -0
- /package/{typings → types}/utils.d.ts +0 -0
package/cjs/{Send.js → Send.cjs}
RENAMED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
'use strict';
|
|
2
11
|
|
|
3
12
|
var etag = require('etag');
|
|
@@ -6,7 +15,7 @@ var stream = require('stream');
|
|
|
6
15
|
var fs = require('fs');
|
|
7
16
|
var path = require('path');
|
|
8
17
|
var parseRange = require('range-parser');
|
|
9
|
-
var utils = require('./utils.
|
|
18
|
+
var utils = require('./utils.cjs');
|
|
10
19
|
|
|
11
20
|
/**
|
|
12
21
|
* @module Send
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
'use strict';
|
|
2
11
|
|
|
3
|
-
var Send = require('./Send.
|
|
12
|
+
var Send = require('./Send.cjs');
|
|
4
13
|
|
|
5
14
|
/**
|
|
6
15
|
* @module index
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
'use strict';
|
|
2
11
|
|
|
3
12
|
var fs = require('fs');
|
package/esm/Send.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import etag from 'etag';
|
|
2
11
|
import destroy from 'destroy';
|
|
3
12
|
import { PassThrough } from 'stream';
|
package/esm/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import Send from './Send.js';
|
|
2
11
|
|
|
3
12
|
/**
|
package/esm/utils.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package koa-files
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @version 2.3.0
|
|
5
|
+
* @author nuintun <nuintun@qq.com>
|
|
6
|
+
* @description A static files serving middleware for koa.
|
|
7
|
+
* @see https://github.com/nuintun/koa-files#readme
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import fs from 'fs';
|
|
2
11
|
import { isAbsolute, relative } from 'path';
|
|
3
12
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koa-files",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A static files serving middleware for koa.",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "cjs/index.cjs",
|
|
6
7
|
"module": "esm/index.js",
|
|
7
|
-
"
|
|
8
|
+
"types": "types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./esm/index.js",
|
|
11
|
+
"require": "./cjs/index.cjs"
|
|
12
|
+
},
|
|
8
13
|
"files": [
|
|
9
14
|
"cjs",
|
|
10
15
|
"esm",
|
|
11
|
-
"
|
|
16
|
+
"types"
|
|
12
17
|
],
|
|
13
18
|
"scripts": {
|
|
14
|
-
"
|
|
19
|
+
"test": "node tests",
|
|
15
20
|
"lint": "tsc --noEmit",
|
|
16
21
|
"clean": "node tools/clean.js",
|
|
17
22
|
"prepublishOnly": "npm run build",
|
|
18
23
|
"build:cjs": "rollup -c tools/rollup.cjs.js",
|
|
19
24
|
"build:esm": "rollup -c tools/rollup.esm.js",
|
|
20
|
-
"format": "prettier --write tools src cjs esm tests
|
|
25
|
+
"format": "prettier --write tools src cjs esm tests types",
|
|
21
26
|
"build": "npm run clean && npm run build:main && npm run format",
|
|
22
|
-
"build:main": "npm run build:cjs && npm run build:esm && npm run build:
|
|
23
|
-
"build:
|
|
27
|
+
"build:main": "npm run build:cjs && npm run build:esm && npm run build:types",
|
|
28
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --declarationDir types"
|
|
24
29
|
},
|
|
25
30
|
"repository": {
|
|
26
31
|
"type": "git",
|
|
@@ -28,11 +33,11 @@
|
|
|
28
33
|
},
|
|
29
34
|
"keywords": [
|
|
30
35
|
"koa",
|
|
36
|
+
"send",
|
|
37
|
+
"serve",
|
|
31
38
|
"server",
|
|
32
39
|
"static",
|
|
33
40
|
"service",
|
|
34
|
-
"send",
|
|
35
|
-
"serve",
|
|
36
41
|
"middleware"
|
|
37
42
|
],
|
|
38
43
|
"engines": {
|
|
@@ -54,10 +59,10 @@
|
|
|
54
59
|
"destroy": "^1.2.0",
|
|
55
60
|
"etag": "^1.8.1",
|
|
56
61
|
"range-parser": "^1.2.1",
|
|
57
|
-
"tslib": "^2.
|
|
62
|
+
"tslib": "^2.4.0"
|
|
58
63
|
},
|
|
59
64
|
"devDependencies": {
|
|
60
|
-
"@rollup/plugin-typescript": "^8.3.
|
|
65
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
61
66
|
"@types/destroy": "^1.0.0",
|
|
62
67
|
"@types/etag": "^1.8.1",
|
|
63
68
|
"@types/koa": "^2.13.4",
|
|
@@ -66,7 +71,7 @@
|
|
|
66
71
|
"magic-string": "^0.26.1",
|
|
67
72
|
"prettier": "^2.6.2",
|
|
68
73
|
"rimraf": "^3.0.2",
|
|
69
|
-
"rollup": "^2.
|
|
70
|
-
"typescript": "^4.6.
|
|
74
|
+
"rollup": "^2.72.1",
|
|
75
|
+
"typescript": "^4.6.4"
|
|
71
76
|
}
|
|
72
77
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|