@hono/node-server 0.2.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/README.md +103 -0
- package/dist/base64.d.ts +2 -0
- package/dist/base64.js +11 -0
- package/dist/fetch.d.ts +27 -0
- package/dist/fetch.js +46 -0
- package/dist/globals.d.ts +27 -0
- package/dist/globals.js +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -0
- package/dist/serve-static.d.ts +8 -0
- package/dist/serve-static.js +36 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.js +79 -0
- package/dist/stream.d.ts +7 -0
- package/dist/stream.js +27 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Hono on Node.js
|
|
2
|
+
|
|
3
|
+
**`@honojs/node-server` is renamed to `@hono/node-serer` !!**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This is **HTTP Server for Hono on Node.js**.
|
|
8
|
+
Hono is ultrafast web framework for Cloudflare Workers, Deno, and Bun.
|
|
9
|
+
**It's not for Node.js**.
|
|
10
|
+
**BUT**, there may be a case that you really want to run on Node.js. This library is an adapter server that connects Hono and Node.js.
|
|
11
|
+
|
|
12
|
+
Hono is ultra fast, but not so fast on Node.js, because there is an overhead to adapt Hono's API to Node.js.
|
|
13
|
+
|
|
14
|
+
By the way, it is 2.x times faster than Express.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
You can install from npm registry with `npm` command:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npm install @hono/node-server
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or use `yarn`:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
yarn add @hono/node-server
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Just import `@hono/node-server` at the top and write the code as usual.
|
|
33
|
+
The same code that runs on Cloudflare Workers, Deno, and Bun will work.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { serve } from '@hono/node-server'
|
|
37
|
+
import { Hono } from 'hono'
|
|
38
|
+
|
|
39
|
+
const app = new Hono()
|
|
40
|
+
app.get('/', (c) => c.text('Hono meets Node.js'))
|
|
41
|
+
|
|
42
|
+
serve(app)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
ts-node ./index.ts
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Open `http://localhost:3000` with your browser.
|
|
52
|
+
|
|
53
|
+
## Options
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
serve({
|
|
57
|
+
fetch: app.fetch,
|
|
58
|
+
port: 8787, // Port number, default is 3000
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Middleware
|
|
63
|
+
|
|
64
|
+
Most built-in middleware also works with Node.js.
|
|
65
|
+
Read [the documentation](https://honojs.dev/docs/builtin-middleware/) and use the Middleware of your liking.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { serve } from '@hono/node-server'
|
|
69
|
+
import { Hono } from 'hono'
|
|
70
|
+
import { prettyJSON } from 'hono/pretty-json'
|
|
71
|
+
|
|
72
|
+
const app = new Hono()
|
|
73
|
+
|
|
74
|
+
app.get('*', prettyJSON())
|
|
75
|
+
app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' }))
|
|
76
|
+
|
|
77
|
+
serve(app)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Serve Static Middleware
|
|
81
|
+
|
|
82
|
+
Use Serve Static Middleware that has been created for Node.js.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
import { serve, serveStatic } from '@hono/node-server'
|
|
86
|
+
|
|
87
|
+
//...
|
|
88
|
+
|
|
89
|
+
app.use('/static/*', serveStatic({ root: './' }))
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Related projects
|
|
93
|
+
|
|
94
|
+
- Hono - <https://honojs.dev>
|
|
95
|
+
- Hono GitHub repository - <https://github.com/honojs/hono>
|
|
96
|
+
|
|
97
|
+
## Author
|
|
98
|
+
|
|
99
|
+
Yusuke Wada <https://github.com/yusukebe>
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT
|
package/dist/base64.d.ts
ADDED
package/dist/base64.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.btoa = exports.atob = void 0;
|
|
4
|
+
function atob(a) {
|
|
5
|
+
return Buffer.from(a, 'base64').toString('binary');
|
|
6
|
+
}
|
|
7
|
+
exports.atob = atob;
|
|
8
|
+
function btoa(b) {
|
|
9
|
+
return Buffer.from(b, 'binary').toString('base64');
|
|
10
|
+
}
|
|
11
|
+
exports.btoa = btoa;
|
package/dist/fetch.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Readable } from 'node:stream';
|
|
3
|
+
import { fetch as webFetch, Headers as WebHeaders, Request as WebRequest, Response as WebResponse } from '@remix-run/web-fetch';
|
|
4
|
+
export { FormData } from '@remix-run/web-fetch';
|
|
5
|
+
export { File, Blob } from '@remix-run/web-file';
|
|
6
|
+
declare type NodeHeadersInit = ConstructorParameters<typeof WebHeaders>[0];
|
|
7
|
+
declare type NodeResponseInit = NonNullable<ConstructorParameters<typeof WebResponse>[1]>;
|
|
8
|
+
declare type NodeRequestInfo = ConstructorParameters<typeof WebRequest>[0] | NodeRequest;
|
|
9
|
+
declare type NodeRequestInit = Omit<NonNullable<ConstructorParameters<typeof WebRequest>[1]>, 'body'> & {
|
|
10
|
+
body?: NonNullable<ConstructorParameters<typeof WebRequest>[1]>['body'] | Readable;
|
|
11
|
+
};
|
|
12
|
+
export type { NodeHeadersInit as HeadersInit, NodeRequestInfo as RequestInfo, NodeRequestInit as RequestInit, NodeResponseInit as ResponseInit, };
|
|
13
|
+
declare class NodeRequest extends WebRequest {
|
|
14
|
+
constructor(info: NodeRequestInfo, init?: NodeRequestInit);
|
|
15
|
+
get headers(): WebHeaders;
|
|
16
|
+
clone(): NodeRequest;
|
|
17
|
+
}
|
|
18
|
+
declare class NodeResponse extends WebResponse {
|
|
19
|
+
get headers(): WebHeaders;
|
|
20
|
+
clone(): NodeResponse;
|
|
21
|
+
}
|
|
22
|
+
export { WebHeaders as Headers, NodeRequest as Request, NodeResponse as Response };
|
|
23
|
+
export declare const fetch: typeof webFetch;
|
|
24
|
+
/**
|
|
25
|
+
* Credits:
|
|
26
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/fetch.ts
|
|
27
|
+
*/
|
package/dist/fetch.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetch = exports.Response = exports.Request = exports.Headers = exports.Blob = exports.File = exports.FormData = void 0;
|
|
4
|
+
const web_fetch_1 = require("@remix-run/web-fetch");
|
|
5
|
+
Object.defineProperty(exports, "Headers", { enumerable: true, get: function () { return web_fetch_1.Headers; } });
|
|
6
|
+
var web_fetch_2 = require("@remix-run/web-fetch");
|
|
7
|
+
Object.defineProperty(exports, "FormData", { enumerable: true, get: function () { return web_fetch_2.FormData; } });
|
|
8
|
+
var web_file_1 = require("@remix-run/web-file");
|
|
9
|
+
Object.defineProperty(exports, "File", { enumerable: true, get: function () { return web_file_1.File; } });
|
|
10
|
+
Object.defineProperty(exports, "Blob", { enumerable: true, get: function () { return web_file_1.Blob; } });
|
|
11
|
+
class NodeRequest extends web_fetch_1.Request {
|
|
12
|
+
constructor(info, init) {
|
|
13
|
+
super(info, init);
|
|
14
|
+
}
|
|
15
|
+
get headers() {
|
|
16
|
+
return super.headers;
|
|
17
|
+
}
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
clone() {
|
|
20
|
+
return new NodeRequest(this);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Request = NodeRequest;
|
|
24
|
+
class NodeResponse extends web_fetch_1.Response {
|
|
25
|
+
get headers() {
|
|
26
|
+
return super.headers;
|
|
27
|
+
}
|
|
28
|
+
clone() {
|
|
29
|
+
return super.clone();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Response = NodeResponse;
|
|
33
|
+
const fetch = (info, init) => {
|
|
34
|
+
init = {
|
|
35
|
+
// Disable compression handling so people can return the result of a fetch
|
|
36
|
+
// directly in the loader without messing with the Content-Encoding header.
|
|
37
|
+
compress: false,
|
|
38
|
+
...init,
|
|
39
|
+
};
|
|
40
|
+
return (0, web_fetch_1.fetch)(info, init);
|
|
41
|
+
};
|
|
42
|
+
exports.fetch = fetch;
|
|
43
|
+
/**
|
|
44
|
+
* Credits:
|
|
45
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/fetch.ts
|
|
46
|
+
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { atob, btoa } from './base64';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace NodeJS {
|
|
4
|
+
interface ProcessEnv {
|
|
5
|
+
NODE_ENV: 'development' | 'production' | 'test';
|
|
6
|
+
}
|
|
7
|
+
interface Global {
|
|
8
|
+
atob: typeof atob;
|
|
9
|
+
btoa: typeof btoa;
|
|
10
|
+
Blob: typeof Blob;
|
|
11
|
+
File: typeof File;
|
|
12
|
+
Headers: typeof Headers;
|
|
13
|
+
Request: typeof Request;
|
|
14
|
+
Response: typeof Response;
|
|
15
|
+
fetch: typeof fetch;
|
|
16
|
+
FormData: typeof FormData;
|
|
17
|
+
ReadableStream: typeof ReadableStream;
|
|
18
|
+
WritableStream: typeof WritableStream;
|
|
19
|
+
crypto: Crypto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare function installGlobals(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Credits:
|
|
26
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/globals.ts
|
|
27
|
+
*/
|
package/dist/globals.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.installGlobals = void 0;
|
|
7
|
+
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
8
|
+
const web_stream_1 = require("@remix-run/web-stream");
|
|
9
|
+
const base64_1 = require("./base64");
|
|
10
|
+
const fetch_1 = require("./fetch");
|
|
11
|
+
function installGlobals() {
|
|
12
|
+
global.atob = base64_1.atob;
|
|
13
|
+
global.btoa = base64_1.btoa;
|
|
14
|
+
global.Blob = fetch_1.Blob;
|
|
15
|
+
global.File = fetch_1.File;
|
|
16
|
+
global.Headers = fetch_1.Headers;
|
|
17
|
+
global.Request = fetch_1.Request;
|
|
18
|
+
global.Response = fetch_1.Response;
|
|
19
|
+
global.fetch = fetch_1.fetch;
|
|
20
|
+
global.FormData = fetch_1.FormData;
|
|
21
|
+
global.ReadableStream = web_stream_1.ReadableStream;
|
|
22
|
+
global.WritableStream = web_stream_1.WritableStream;
|
|
23
|
+
global.crypto = node_crypto_1.default;
|
|
24
|
+
}
|
|
25
|
+
exports.installGlobals = installGlobals;
|
|
26
|
+
/**
|
|
27
|
+
* Credits:
|
|
28
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/globals.ts
|
|
29
|
+
*/
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serveStatic = exports.serve = void 0;
|
|
4
|
+
var server_1 = require("./server");
|
|
5
|
+
Object.defineProperty(exports, "serve", { enumerable: true, get: function () { return server_1.serve; } });
|
|
6
|
+
var serve_static_1 = require("./serve-static");
|
|
7
|
+
Object.defineProperty(exports, "serveStatic", { enumerable: true, get: function () { return serve_static_1.serveStatic; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Next } from 'hono';
|
|
2
|
+
import { Context } from 'hono';
|
|
3
|
+
export declare type ServeStaticOptions = {
|
|
4
|
+
root?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
index?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const serveStatic: (options?: ServeStaticOptions) => (c: Context, next: Next) => Promise<Response | undefined>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serveStatic = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const filepath_1 = require("hono/utils/filepath");
|
|
6
|
+
const mime_1 = require("hono/utils/mime");
|
|
7
|
+
const serveStatic = (options = { root: '' }) => {
|
|
8
|
+
return async (c, next) => {
|
|
9
|
+
// Do nothing if Response is already set
|
|
10
|
+
if (c.finalized) {
|
|
11
|
+
await next();
|
|
12
|
+
}
|
|
13
|
+
const url = new URL(c.req.url);
|
|
14
|
+
let path = (0, filepath_1.getFilePath)({
|
|
15
|
+
filename: options.path ?? url.pathname,
|
|
16
|
+
root: options.root,
|
|
17
|
+
defaultDocument: options.index ?? 'index.html',
|
|
18
|
+
});
|
|
19
|
+
path = `./${path}`;
|
|
20
|
+
if ((0, fs_1.existsSync)(path)) {
|
|
21
|
+
const content = (0, fs_1.readFileSync)(path);
|
|
22
|
+
if (content) {
|
|
23
|
+
const mimeType = (0, mime_1.getMimeType)(path);
|
|
24
|
+
if (mimeType) {
|
|
25
|
+
c.header('Content-Type', mimeType);
|
|
26
|
+
}
|
|
27
|
+
// Return Response object
|
|
28
|
+
return c.body(content);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
console.warn(`Static file: ${path} is not found`);
|
|
32
|
+
await next();
|
|
33
|
+
return;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.serveStatic = serveStatic;
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Server } from 'node:http';
|
|
2
|
+
declare type FetchCallback = (request: Request) => Promise<unknown> | unknown;
|
|
3
|
+
declare type Options = {
|
|
4
|
+
fetch: FetchCallback;
|
|
5
|
+
port?: number;
|
|
6
|
+
serverOptions?: Object;
|
|
7
|
+
};
|
|
8
|
+
export declare const createAdaptorServer: (options: Options) => Server;
|
|
9
|
+
export declare const serve: (options: Options) => Server;
|
|
10
|
+
export {};
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serve = exports.createAdaptorServer = void 0;
|
|
4
|
+
const node_http_1 = require("node:http");
|
|
5
|
+
const fetch_1 = require("./fetch");
|
|
6
|
+
const stream_1 = require("./stream");
|
|
7
|
+
const globals_1 = require("./globals");
|
|
8
|
+
(0, globals_1.installGlobals)();
|
|
9
|
+
const createAdaptorServer = (options) => {
|
|
10
|
+
const fetchCallback = options.fetch;
|
|
11
|
+
const requestListener = getRequestListener(fetchCallback);
|
|
12
|
+
const server = (0, node_http_1.createServer)(options.serverOptions || {}, requestListener);
|
|
13
|
+
return server;
|
|
14
|
+
};
|
|
15
|
+
exports.createAdaptorServer = createAdaptorServer;
|
|
16
|
+
const serve = (options) => {
|
|
17
|
+
const server = (0, exports.createAdaptorServer)(options);
|
|
18
|
+
server.listen(options.port || 3000);
|
|
19
|
+
return server;
|
|
20
|
+
};
|
|
21
|
+
exports.serve = serve;
|
|
22
|
+
const getRequestListener = (fetchCallback) => {
|
|
23
|
+
return async (incoming, outgoing) => {
|
|
24
|
+
const method = incoming.method || 'GET';
|
|
25
|
+
const url = `http://${incoming.headers.host}${incoming.url}`;
|
|
26
|
+
const headerRecord = {};
|
|
27
|
+
const len = incoming.rawHeaders.length;
|
|
28
|
+
for (let i = 0; i < len; i++) {
|
|
29
|
+
if (i % 2 === 0) {
|
|
30
|
+
const key = incoming.rawHeaders[i];
|
|
31
|
+
headerRecord[key] = incoming.rawHeaders[i + 1];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const init = {
|
|
35
|
+
method: method,
|
|
36
|
+
headers: headerRecord,
|
|
37
|
+
};
|
|
38
|
+
if (!(method === 'GET' || method === 'HEAD')) {
|
|
39
|
+
const buffers = [];
|
|
40
|
+
for await (const chunk of incoming) {
|
|
41
|
+
buffers.push(chunk);
|
|
42
|
+
}
|
|
43
|
+
const buffer = Buffer.concat(buffers);
|
|
44
|
+
init['body'] = buffer;
|
|
45
|
+
}
|
|
46
|
+
let res;
|
|
47
|
+
try {
|
|
48
|
+
res = (await fetchCallback(new Request(url.toString(), init)));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
res = new fetch_1.Response(null, { status: 500 });
|
|
52
|
+
}
|
|
53
|
+
const contentType = res.headers.get('content-type') || '';
|
|
54
|
+
const contentEncoding = res.headers.get('content-encoding');
|
|
55
|
+
for (const [k, v] of res.headers) {
|
|
56
|
+
if (k === 'set-cookie') {
|
|
57
|
+
outgoing.setHeader(k, res.headers.getAll(k));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
outgoing.setHeader(k, v);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
outgoing.statusCode = res.status;
|
|
64
|
+
if (res.body) {
|
|
65
|
+
if (!contentEncoding && contentType.startsWith('text')) {
|
|
66
|
+
outgoing.end(await res.text());
|
|
67
|
+
}
|
|
68
|
+
else if (!contentEncoding && contentType.startsWith('application/json')) {
|
|
69
|
+
outgoing.end(await res.text());
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
await (0, stream_1.writeReadableStreamToWritable)(res.body, outgoing);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
outgoing.end();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
package/dist/stream.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Writable } from 'node:stream';
|
|
3
|
+
export declare function writeReadableStreamToWritable(stream: ReadableStream, writable: Writable): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* Credits:
|
|
6
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/stream.ts
|
|
7
|
+
*/
|
package/dist/stream.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeReadableStreamToWritable = void 0;
|
|
4
|
+
async function writeReadableStreamToWritable(stream, writable) {
|
|
5
|
+
let reader = stream.getReader();
|
|
6
|
+
async function read() {
|
|
7
|
+
let { done, value } = await reader.read();
|
|
8
|
+
if (done) {
|
|
9
|
+
writable.end();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
writable.write(value);
|
|
13
|
+
await read();
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
await read();
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
writable.destroy(error);
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.writeReadableStreamToWritable = writeReadableStreamToWritable;
|
|
24
|
+
/**
|
|
25
|
+
* Credits:
|
|
26
|
+
* - https://github.com/remix-run/remix/blob/e77e2eb/packages/remix-node/stream.ts
|
|
27
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hono/node-server",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "HTTP Server for Hono on Node.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"build": "rimraf dist && tsc",
|
|
13
|
+
"prerelease": "yarn build && yarn test",
|
|
14
|
+
"release": "np"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/hono/node-server.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/hono/node-server",
|
|
22
|
+
"author": "Yusuke Wada <yusuke@kamawada.com> (https://github.com/yusukebe)",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"registry": "https://registry.npmjs.org",
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@remix-run/web-fetch": "^4.2.0",
|
|
29
|
+
"@remix-run/web-file": "^3.0.2",
|
|
30
|
+
"@remix-run/web-stream": "^1.0.3"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/jest": "^29.0.1",
|
|
34
|
+
"@types/node": "^18.7.16",
|
|
35
|
+
"@types/supertest": "^2.0.12",
|
|
36
|
+
"hono": "^2.7.1",
|
|
37
|
+
"jest": "^29.0.3",
|
|
38
|
+
"np": "^7.6.2",
|
|
39
|
+
"rimraf": "^3.0.2",
|
|
40
|
+
"supertest": "^6.2.4",
|
|
41
|
+
"ts-jest": "^29.0.0",
|
|
42
|
+
"typescript": "^4.8.3"
|
|
43
|
+
}
|
|
44
|
+
}
|