@hono/node-server
Advanced tools
+10
-0
@@ -29,2 +29,4 @@ "use strict"; | ||
| var import_node_path = require("path"); | ||
| var import_node_process = require("process"); | ||
| var import_node_stream = require("stream"); | ||
| var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; | ||
@@ -37,3 +39,11 @@ var ENCODINGS = { | ||
| var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); | ||
| var pr54206Applied = () => { | ||
| const [major, minor] = import_node_process.versions.node.split(".").map((component) => parseInt(component)); | ||
| return major >= 23 || major === 22 && minor >= 7 || major === 20 && minor >= 18; | ||
| }; | ||
| var useReadableToWeb = pr54206Applied(); | ||
| var createStreamBody = (stream) => { | ||
| if (useReadableToWeb) { | ||
| return import_node_stream.Readable.toWeb(stream); | ||
| } | ||
| const body = new ReadableStream({ | ||
@@ -40,0 +50,0 @@ start(controller) { |
@@ -5,2 +5,4 @@ // src/serve-static.ts | ||
| import { join } from "path"; | ||
| import { versions } from "process"; | ||
| import { Readable } from "stream"; | ||
| var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; | ||
@@ -13,3 +15,11 @@ var ENCODINGS = { | ||
| var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS); | ||
| var pr54206Applied = () => { | ||
| const [major, minor] = versions.node.split(".").map((component) => parseInt(component)); | ||
| return major >= 23 || major === 22 && minor >= 7 || major === 20 && minor >= 18; | ||
| }; | ||
| var useReadableToWeb = pr54206Applied(); | ||
| var createStreamBody = (stream) => { | ||
| if (useReadableToWeb) { | ||
| return Readable.toWeb(stream); | ||
| } | ||
| const body = new ReadableStream({ | ||
@@ -16,0 +26,0 @@ start(controller) { |
+1
-1
| { | ||
| "name": "@hono/node-server", | ||
| "version": "1.19.7", | ||
| "version": "1.19.8", | ||
| "description": "Node.js Adapter for Hono", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+17
-0
@@ -329,2 +329,19 @@ # Node.js Adapter for Hono | ||
| ## Listen to a UNIX domain socket | ||
| You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port. | ||
| ```ts | ||
| import { createAdaptorServer } from '@hono/node-server' | ||
| // ... | ||
| const socketPath ='/tmp/example.sock' | ||
| const server = createAdaptorServer(app) | ||
| server.listen(socketPath, () => { | ||
| console.log(`Listening on ${socketPath}`) | ||
| }) | ||
| ``` | ||
| ## Related projects | ||
@@ -331,0 +348,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
206428
0.58%6071
0.33%358
4.99%