Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hono/node-server

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/node-server - npm Package Compare versions

Comparing version 1.8.2 to 1.9.0

dist/utils/response.d.mts

4

dist/index.js

@@ -286,2 +286,5 @@ "use strict";

// src/utils/response/constants.ts
var X_ALREADY_SENT = "x-hono-already-sent";
// src/globals.ts

@@ -386,2 +389,3 @@ var import_node_crypto = __toESM(require("crypto"));

}
} else if (resHeaderRecord[X_ALREADY_SENT]) {
} else {

@@ -388,0 +392,0 @@ outgoing.writeHead(res.status, resHeaderRecord);

@@ -281,2 +281,5 @@ "use strict";

// src/utils/response/constants.ts
var X_ALREADY_SENT = "x-hono-already-sent";
// src/globals.ts

@@ -381,2 +384,3 @@ var import_node_crypto = __toESM(require("crypto"));

}
} else if (resHeaderRecord[X_ALREADY_SENT]) {
} else {

@@ -383,0 +387,0 @@ outgoing.writeHead(res.status, resHeaderRecord);

@@ -283,2 +283,5 @@ "use strict";

// src/utils/response/constants.ts
var X_ALREADY_SENT = "x-hono-already-sent";
// src/globals.ts

@@ -383,2 +386,3 @@ var import_node_crypto = __toESM(require("crypto"));

}
} else if (resHeaderRecord[X_ALREADY_SENT]) {
} else {

@@ -385,0 +389,0 @@ outgoing.writeHead(res.status, resHeaderRecord);

@@ -281,2 +281,5 @@ "use strict";

// src/utils/response/constants.ts
var X_ALREADY_SENT = "x-hono-already-sent";
// src/globals.ts

@@ -381,2 +384,3 @@ var import_node_crypto = __toESM(require("crypto"));

}
} else if (resHeaderRecord[X_ALREADY_SENT]) {
} else {

@@ -383,0 +387,0 @@ outgoing.writeHead(res.status, resHeaderRecord);

{
"name": "@hono/node-server",
"version": "1.8.2",
"version": "1.9.0",
"description": "Node.js Adapter for Hono",

@@ -25,2 +25,7 @@ "main": "dist/index.js",

"import": "./dist/vercel.mjs"
},
"./utils/*": {
"types": "./dist/utils/*.d.ts",
"require": "./dist/utils/*.js",
"import": "./dist/utils/*.mjs"
}

@@ -38,2 +43,5 @@ },

"./dist/vercel.d.ts"
],
"utils/*": [
"./dist/utils/*.d.ts"
]

@@ -40,0 +48,0 @@ }

@@ -215,2 +215,29 @@ # Node.js Adapter for Hono

## Direct response from Node.js API
You can directly respond to the client from the Node.js API.
In that case, the response from Hono should be ignored, so return `RESPONSE_ALREADY_SENT`.
> [!NOTE]
> This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications.
```ts
import { serve } from '@hono/node-server'
import type { HttpBindings } from '@hono/node-server'
import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response'
import { Hono } from 'hono'
const app = new Hono<{ Bindings: HttpBindings }>()
app.get('/', (c) => {
const { outgoing } = c.env
outgoing.writeHead(200, { 'Content-Type': 'text/plain' })
outgoing.end('Hello World\n')
return RESPONSE_ALREADY_SENT
})
serve(app)
```
## Related projects

@@ -217,0 +244,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc