woodland 18.2.1 → 18.2.3

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
6
6
  * @license BSD-3-Clause
7
- * @version 18.2.1
7
+ * @version 18.2.3
8
8
  */
9
9
  'use strict';
10
10
 
@@ -25,6 +25,7 @@ const CONTENT_TYPE = "content-type";
25
25
  const EQUAL = "=";
26
26
  const EN_US = "en-US";
27
27
  const HYPHEN = "-";
28
+ const INFO = "info";
28
29
  const INT_8000 = 8000;
29
30
  const LOCALHOST = "127.0.0.1";
30
31
  const SHORT = "short";
@@ -55,4 +56,4 @@ const app = woodland.woodland({
55
56
 
56
57
  app.staticFiles();
57
58
  node_http.createServer(app.route).listen(port, ip);
58
- app.log(`id=woodland, hostname=localhost, ip=${ip}, port=${port}`);
59
+ app.log(`id=woodland, hostname=localhost, ip=${ip}, port=${port}`, INFO);
package/dist/woodland.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
5
5
  * @license BSD-3-Clause
6
- * @version 18.2.1
6
+ * @version 18.2.3
7
7
  */
8
8
  'use strict';
9
9
 
package/dist/woodland.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
5
5
  * @license BSD-3-Clause
6
- * @version 18.2.1
6
+ * @version 18.2.3
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.1",
3
+ "version": "18.2.3",
4
4
  "description": "Lightweight HTTP framework with automatic headers",
5
5
  "type": "module",
6
6
  "types": "types/woodland.d.ts",
@@ -58,20 +58,20 @@
58
58
  "dependencies": {
59
59
  "mime-db": "^1.52.0",
60
60
  "precise": "^4.0.3",
61
- "tiny-coerce": "^3.0.1",
62
- "tiny-etag": "^4.0.4",
63
- "tiny-lru": "^11.2.3"
61
+ "tiny-coerce": "^3.0.2",
62
+ "tiny-etag": "^4.0.5",
63
+ "tiny-lru": "^11.2.5"
64
64
  },
65
65
  "devDependencies": {
66
66
  "auto-changelog": "^2.4.0",
67
- "autocannon": "^7.12.0",
68
- "concurrently": "^8.2.1",
69
- "eslint": "^8.51.0",
67
+ "autocannon": "^7.14.0",
68
+ "concurrently": "^8.2.2",
69
+ "eslint": "^8.56.0",
70
70
  "husky": "^8.0.3",
71
71
  "mocha": "^10.2.0",
72
72
  "nyc": "^15.1.0",
73
- "rollup": "^4.0.2",
74
- "tiny-httptest": "^4.0.7",
75
- "typescript": "^5.2.2"
73
+ "rollup": "^4.9.1",
74
+ "tiny-httptest": "^4.0.9",
75
+ "typescript": "^5.3.3"
76
76
  }
77
77
  }
@@ -38,6 +38,27 @@ export const IF_MODIFIED_SINCE: "if-modified-since";
38
38
  export const INDEX_HTM: "index.htm";
39
39
  export const INDEX_HTML: "index.html";
40
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;
41
62
  export const IP_TOKEN: "%IP";
42
63
  export const KEY_BYTES: "bytes=";
43
64
  export const LAST_MODIFIED: "last-modified";
@@ -85,7 +106,7 @@ export const OBJECT: "object";
85
106
  export const OPTIONS: "OPTIONS";
86
107
  export const OPTIONS_BODY: "Make a GET request to retrieve the file";
87
108
  export const ORIGIN: "origin";
88
- export const PARAMS_GROUP: "/([^/]+)";
109
+ export const PARAMS_GROUP: "/(?<$1>[^/]+)";
89
110
  export const PATCH: "PATCH";
90
111
  export const PERIOD: ".";
91
112
  export const POST: "POST";
@@ -3,7 +3,7 @@ export function getStatus(req: any, res: any): any;
3
3
  export function ms(arg?: number, digits?: number): string;
4
4
  export function next(req: any, res: any, middleware: any): (err: any) => any;
5
5
  export function pad(arg?: number): any;
6
- export function params(req: any, pos?: any[]): void;
6
+ export function params(req: any, getParams: any): void;
7
7
  export function parse(arg: any): any;
8
8
  export function partialHeaders(req: any, res: any, size: any, status: any, headers?: {}, options?: {}): {}[];
9
9
  export function pipeable(method: any, arg: any): boolean;
@@ -19,7 +19,7 @@ export class Woodland {
19
19
  cache: import("tiny-lru").LRU<any>;
20
20
  charset: string;
21
21
  corsExpose: string;
22
- defaultHeaders: any[][];
22
+ defaultHeaders: any;
23
23
  digit: number;
24
24
  etags: {
25
25
  cache: import("tiny-lru").LRU<any>;
@@ -78,6 +78,7 @@ export class Woodland {
78
78
  set(res: any): (arg?: {}) => any;
79
79
  serve(req: any, res: any, arg?: string, folder?: any, index?: string[]): Promise<void>;
80
80
  status(res: any): (arg?: number) => any;
81
+ staticFiles(root?: string): void;
81
82
  trace(...args: any[]): this;
82
83
  use(rpath: any, ...fn: any[]): this;
83
84
  }