woodland 18.2.6 → 18.2.7
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/dist/cli.cjs +1 -1
- package/dist/woodland.cjs +1 -1
- package/dist/woodland.js +1 -1
- package/package.json +2 -2
- package/types/constants.d.ts +0 -139
- package/types/utility.d.ts +0 -21
package/dist/cli.cjs
CHANGED
package/dist/woodland.cjs
CHANGED
package/dist/woodland.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
5
5
|
* @license BSD-3-Clause
|
|
6
|
-
* @version 18.2.
|
|
6
|
+
* @version 18.2.7
|
|
7
7
|
*/
|
|
8
8
|
import {STATUS_CODES,METHODS}from'node:http';import {join,extname,resolve}from'node:path';import {EventEmitter}from'node:events';import {stat,readdir}from'node:fs/promises';import {etag}from'tiny-etag';import {precise}from'precise';import {lru}from'tiny-lru';import {createRequire}from'node:module';import {fileURLToPath,URL}from'node:url';import {readFileSync,createReadStream}from'node:fs';import {coerce}from'tiny-coerce';import mimeDb from'mime-db';const __dirname$1 = fileURLToPath(new URL(".", import.meta.url));
|
|
9
9
|
const require = createRequire(import.meta.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "woodland",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.7",
|
|
4
4
|
"description": "Lightweight HTTP framework with automatic headers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "types/woodland.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
16
|
"tpl",
|
|
17
|
-
"types"
|
|
17
|
+
"types/woodland.d.ts"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"benchmark": "node benchmark.js",
|
package/types/constants.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
export const ACCESS_CONTROL_ALLOW_CREDENTIALS: "access-control-allow-credentials";
|
|
2
|
-
export const ACCESS_CONTROL_ALLOW_HEADERS: "access-control-allow-headers";
|
|
3
|
-
export const ACCESS_CONTROL_ALLOW_METHODS: "access-control-allow-methods";
|
|
4
|
-
export const ACCESS_CONTROL_ALLOW_ORIGIN: "access-control-allow-origin";
|
|
5
|
-
export const ACCESS_CONTROL_EXPOSE_HEADERS: "access-control-expose-headers";
|
|
6
|
-
export const ACCESS_CONTROL_REQUEST_HEADERS: "access-control-request-headers";
|
|
7
|
-
export const ALLOW: "allow";
|
|
8
|
-
export const APPLICATION_JSON: "application/json";
|
|
9
|
-
export const APPLICATION_OCTET_STREAM: "application/octet-stream";
|
|
10
|
-
export const ARRAY: "array";
|
|
11
|
-
export const CACHE_CONTROL: "cache-control";
|
|
12
|
-
export const CHAR_SET: "charset=utf-8";
|
|
13
|
-
export const COLON: ":";
|
|
14
|
-
export const COMMA: ",";
|
|
15
|
-
export const COMMA_SPACE: ", ";
|
|
16
|
-
export const CONNECT: "CONNECT";
|
|
17
|
-
export const CONTENT_LENGTH: "content-length";
|
|
18
|
-
export const CONTENT_RANGE: "content-range";
|
|
19
|
-
export const CONTENT_TYPE: "content-type";
|
|
20
|
-
export const DEBUG: "debug";
|
|
21
|
-
export const DELETE: "DELETE";
|
|
22
|
-
export const DELIMITER: "|";
|
|
23
|
-
export const EQUAL: "=";
|
|
24
|
-
export const EMPTY: "";
|
|
25
|
-
export const EN_US: "en-US";
|
|
26
|
-
export const END: "end";
|
|
27
|
-
export const ETAG: "etag";
|
|
28
|
-
export const ERROR: "error";
|
|
29
|
-
export const EXTENSIONS: "extensions";
|
|
30
|
-
export const FILES: "files";
|
|
31
|
-
export const FINISH: "finish";
|
|
32
|
-
export const FUNCTION: "function";
|
|
33
|
-
export const GET: "GET";
|
|
34
|
-
export const HEAD: "HEAD";
|
|
35
|
-
export const HYPHEN: "-";
|
|
36
|
-
export const IF_NONE_MATCH: "if-none-match";
|
|
37
|
-
export const IF_MODIFIED_SINCE: "if-modified-since";
|
|
38
|
-
export const INDEX_HTM: "index.htm";
|
|
39
|
-
export const INDEX_HTML: "index.html";
|
|
40
|
-
export const INFO: "info";
|
|
41
|
-
export const INT_0: 0;
|
|
42
|
-
export const INT_2: 2;
|
|
43
|
-
export const INT_3: 3;
|
|
44
|
-
export const INT_4: 4;
|
|
45
|
-
export const INT_10: 10;
|
|
46
|
-
export const INT_60: 60;
|
|
47
|
-
export const INT_200: 200;
|
|
48
|
-
export const INT_204: 204;
|
|
49
|
-
export const INT_206: 206;
|
|
50
|
-
export const INT_304: 304;
|
|
51
|
-
export const INT_307: 307;
|
|
52
|
-
export const INT_308: 308;
|
|
53
|
-
export const INT_403: 403;
|
|
54
|
-
export const INT_404: 404;
|
|
55
|
-
export const INT_405: 405;
|
|
56
|
-
export const INT_416: 416;
|
|
57
|
-
export const INT_500: 500;
|
|
58
|
-
export const INT_8000: 8000;
|
|
59
|
-
export const INT_1e3: 1000;
|
|
60
|
-
export const INT_1e4: 10000;
|
|
61
|
-
export const INT_1e6: 1000000;
|
|
62
|
-
export const IP_TOKEN: "%IP";
|
|
63
|
-
export const KEY_BYTES: "bytes=";
|
|
64
|
-
export const LAST_MODIFIED: "last-modified";
|
|
65
|
-
export const LEFT_PAREN: "(";
|
|
66
|
-
export const LEVELS: Readonly<{
|
|
67
|
-
emerg: 0;
|
|
68
|
-
alert: 1;
|
|
69
|
-
crit: 2;
|
|
70
|
-
error: 3;
|
|
71
|
-
warn: 4;
|
|
72
|
-
notice: 5;
|
|
73
|
-
info: 6;
|
|
74
|
-
debug: 7;
|
|
75
|
-
}>;
|
|
76
|
-
export const LOCALHOST: "127.0.0.1";
|
|
77
|
-
export const LOCATION: "location";
|
|
78
|
-
export const LOG: "log";
|
|
79
|
-
export const LOG_B: "%b";
|
|
80
|
-
export const LOG_FORMAT: "%h %l %u %t \"%r\" %>s %b";
|
|
81
|
-
export const LOG_H: "%h";
|
|
82
|
-
export const LOG_L: "%l";
|
|
83
|
-
export const LOG_R: "%r";
|
|
84
|
-
export const LOG_REFERRER: "%{Referer}i";
|
|
85
|
-
export const LOG_S: "%>s";
|
|
86
|
-
export const LOG_T: "%t";
|
|
87
|
-
export const LOG_U: "%u";
|
|
88
|
-
export const LOG_USER_AGENT: "%{User-agent}i";
|
|
89
|
-
export const LOG_V: "%v";
|
|
90
|
-
export const SHORT: "short";
|
|
91
|
-
export const MONTHS: any;
|
|
92
|
-
export const MSG_DETERMINED_ALLOW: "Determined 'allow' header value";
|
|
93
|
-
export const MSG_ERROR_HEAD_ROUTE: "Cannot set HEAD route, use GET";
|
|
94
|
-
export const MSG_ERROR_INVALID_METHOD: "Invalid HTTP method";
|
|
95
|
-
export const MSG_SENDING_BODY: "Sending response body";
|
|
96
|
-
export const MSG_DECORATED_IP: "Decorated request from %IP";
|
|
97
|
-
export const MSG_ERROR_IP: "Handled error response for %IP";
|
|
98
|
-
export const MSG_IGNORED_FN: "Added function to ignored Set";
|
|
99
|
-
export const MSG_ROUTING: "Routing request";
|
|
100
|
-
export const MSG_ROUTING_FILE: "Routing request to file system";
|
|
101
|
-
export const MSG_RETRIEVED_MIDDLEWARE: "Retrieved middleware for request";
|
|
102
|
-
export const MSG_REGISTERING_MIDDLEWARE: "Registering middleware";
|
|
103
|
-
export const MSG_HEADERS_SENT: "Headers already sent";
|
|
104
|
-
export const NO_CACHE: "no-cache";
|
|
105
|
-
export const OBJECT: "object";
|
|
106
|
-
export const OPTIONS: "OPTIONS";
|
|
107
|
-
export const OPTIONS_BODY: "Make a GET request to retrieve the file";
|
|
108
|
-
export const ORIGIN: "origin";
|
|
109
|
-
export const PARAMS_GROUP: "/(?<$1>[^/]+)";
|
|
110
|
-
export const PATCH: "PATCH";
|
|
111
|
-
export const PERIOD: ".";
|
|
112
|
-
export const POST: "POST";
|
|
113
|
-
export const PUT: "PUT";
|
|
114
|
-
export const RANGE: "range";
|
|
115
|
-
export const READ_HEADERS: "GET, HEAD, OPTIONS";
|
|
116
|
-
export const SERVER: "server";
|
|
117
|
-
export const SERVER_VALUE: string;
|
|
118
|
-
export const SLASH: "/";
|
|
119
|
-
export const START: "start";
|
|
120
|
-
export const STRING: "string";
|
|
121
|
-
export const STRING_0: "0";
|
|
122
|
-
export const STRING_00: "00";
|
|
123
|
-
export const STRING_30: "30";
|
|
124
|
-
export const TEXT_PLAIN: "text/plain";
|
|
125
|
-
export const TIME_MS: "%N ms";
|
|
126
|
-
export const TIMING_ALLOW_ORIGIN: "timing-allow-origin";
|
|
127
|
-
export const TITLE: "title";
|
|
128
|
-
export const TO_STRING: "toString";
|
|
129
|
-
export const TOKEN_N: "%N";
|
|
130
|
-
export const TRACE: "TRACE";
|
|
131
|
-
export const TRUE: "true";
|
|
132
|
-
export const USER_AGENT: "user-agent";
|
|
133
|
-
export const UTF8: "utf8";
|
|
134
|
-
export const UTF_8: "utf-8";
|
|
135
|
-
export const WILDCARD: "*";
|
|
136
|
-
export const X_FORWARDED_FOR: "x-forwarded-for";
|
|
137
|
-
export const X_POWERED_BY: "x-powered-by";
|
|
138
|
-
export const X_POWERED_BY_VALUE: string;
|
|
139
|
-
export const X_RESPONSE_TIME: "x-response-time";
|
package/types/utility.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function autoindex(title?: string, files?: any[]): any;
|
|
2
|
-
export function getStatus(req: any, res: any): any;
|
|
3
|
-
export function ms(arg?: number, digits?: number): string;
|
|
4
|
-
export function next(req: any, res: any, middleware: any): (err: any) => any;
|
|
5
|
-
export function pad(arg?: number): any;
|
|
6
|
-
export function params(req: any, getParams: any): void;
|
|
7
|
-
export function parse(arg: any): any;
|
|
8
|
-
export function partialHeaders(req: any, res: any, size: any, status: any, headers?: {}, options?: {}): {}[];
|
|
9
|
-
export function pipeable(method: any, arg: any): boolean;
|
|
10
|
-
export function reduce(uri: any, map?: any, arg?: {}, end?: boolean, ignore?: any): void;
|
|
11
|
-
export function stream(req: any, res: any, file?: {
|
|
12
|
-
charset: string;
|
|
13
|
-
etag: string;
|
|
14
|
-
path: string;
|
|
15
|
-
stats: {
|
|
16
|
-
mtime: Date;
|
|
17
|
-
size: number;
|
|
18
|
-
};
|
|
19
|
-
}): any;
|
|
20
|
-
export function timeOffset(arg?: number): string;
|
|
21
|
-
export function writeHead(res: any, headers?: {}): void;
|