{"_id":"http2-express","_rev":"4-1327292615dcdc1fc7ddfcaa5edb8169","name":"http2-express","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"http2-express","version":"1.0.0","keywords":["express","http2","https","push","support","compatibility","api","server"],"author":{"name":"Mark Jovis"},"license":"MIT","_id":"http2-express@1.0.0","maintainers":[{"name":"markjovis","email":"mark.jovis@hotmail.com"}],"contributors":[{"name":"Mark Jovis","email":"mark.jovis@hotmail.com"}],"homepage":"https://github.com/markjovis/http2-express#readme","bugs":{"url":"https://github.com/markjovis/http2-express/issues"},"dist":{"shasum":"8f5be2c199ca34e9e7565ea2008be1d2a7dbc8c0","tarball":"https://registry.npmjs.org/http2-express/-/http2-express-1.0.0.tgz","fileCount":20,"integrity":"sha512-4sFhcpICPKonFHyBMGD9jT+2/Jg+J8qZTyuOHZPzHe7lbnPPOcJwlYqKfMukfvdH+F+0q6B9zifsHkHEGUJ7cg==","signatures":[{"sig":"MEQCIBlEqGDspakhpMvTueDa75yBad+Q0FrLjsF1IB0SVJzFAiB0P6vC+nSkoXHYzq4HqY3/PDETsvs6PK/wifky3k1MkA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":233244},"main":"dist/index.js","module":"dist/index.js","engines":{"node":">= 20.0.0"},"gitHead":"ee5cb8439afdb5192646a45d23460e8eedf75cda","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist","prepublishOnly":"npm run build","createTypeFiles":"npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"_npmUser":{"name":"markjovis","email":"mark.jovis@hotmail.com"},"repository":{"url":"git+https://github.com/markjovis/http2-express.git","type":"git"},"_npmVersion":"10.8.3","description":"HTTP/2 support for Express","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","@babel/cli":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/eslint-parser":"^7.23.10","eslint-plugin-import":"^2.29.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/http2-express_1.0.0_1730681645444_0.9006923046000719","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"http2-express","version":"1.0.1","keywords":["express","http2","https","push","support","compatibility","api","server"],"author":{"name":"Mark Jovis"},"license":"MIT","_id":"http2-express@1.0.1","maintainers":[{"name":"markjovis","email":"mark.jovis@hotmail.com"}],"contributors":[{"name":"Mark Jovis","email":"mark.jovis@hotmail.com"}],"homepage":"https://github.com/markjovis/http2-express#readme","bugs":{"url":"https://github.com/markjovis/http2-express/issues"},"dist":{"shasum":"5865adc1637220eec55a6dafa2c8d495607751e8","tarball":"https://registry.npmjs.org/http2-express/-/http2-express-1.0.1.tgz","fileCount":17,"integrity":"sha512-3NP5595eHFkZOBD4RXCNDrTQvuxKfcr3Q62RrHlywNc0vw/PR2HKxtF4JqFhXWVJsxb9pTf/1hZ8iLaJrWdUmQ==","signatures":[{"sig":"MEUCIQD47lk98eV9QtjAsNRriYDYTkm9X0ufqmQ778Je0g+kbAIgUHevUc3HqGaZHHNx8WnBoyHOzq+6w5oib1tCwj32iMk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19248},"main":"dist/index.js","module":"dist/index.js","engines":{"node":">= 20.0.0"},"gitHead":"42d7b958f73ab7be1038023090c2f6af011c3a48","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist","prepublishOnly":"npm run build","createTypeFiles":"npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"_npmUser":{"name":"markjovis","email":"mark.jovis@hotmail.com"},"repository":{"url":"git+https://github.com/markjovis/http2-express.git","type":"git"},"_npmVersion":"10.9.2","description":"HTTP/2 support for Express","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","@babel/cli":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/eslint-parser":"^7.23.10","eslint-plugin-import":"^2.29.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/http2-express_1.0.1_1734582316870_0.23928409821485475","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"http2-express","version":"1.1.0","keywords":["express","http2","https","push","support","compatibility","api","server"],"author":{"name":"Mark Jovis"},"license":"MIT","_id":"http2-express@1.1.0","maintainers":[{"name":"markjovis","email":"mark.jovis@hotmail.com"}],"contributors":[{"name":"Mark Jovis","email":"mark.jovis@hotmail.com"}],"homepage":"https://github.com/markjovis/http2-express#readme","bugs":{"url":"https://github.com/markjovis/http2-express/issues"},"dist":{"shasum":"7e7de1ceb06b70a92adb3736df9041a0da6b7f74","tarball":"https://registry.npmjs.org/http2-express/-/http2-express-1.1.0.tgz","fileCount":17,"integrity":"sha512-rEKh5J8KBh76SZ9ejs4q2SQV5X5DA7pMamuGod2ifPLCRcgm8Ru1awbyPPr56JzzMpUY+MKc2NlUxsGpaaqO4Q==","signatures":[{"sig":"MEUCIGqjsbb0dnyOBJgnrt64gwD7M6pjRDRogbkIrpdGvNHRAiEA3uWiRjHw58XrfYxWYC352fgC0qcrS9Mw++NoJ0Op3io=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21639},"main":"dist/index.js","module":"dist/index.js","engines":{"node":">= 20.0.0"},"gitHead":"d095d3eb6fdb37c5c2a70394822ffacbe93c6e8d","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist","prepublishOnly":"npm run build","createTypeFiles":"npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"_npmUser":{"name":"markjovis","email":"mark.jovis@hotmail.com"},"repository":{"url":"git+https://github.com/markjovis/http2-express.git","type":"git"},"_npmVersion":"11.5.2","description":"HTTP/2 support for Express","directories":{},"_nodeVersion":"24.6.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","@babel/cli":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/eslint-parser":"^7.23.10","eslint-plugin-import":"^2.29.1","eslint-config-airbnb-base":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/http2-express_1.1.0_1758153700980_0.7931760086995017","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"http2-express","type":"commonjs","sideEffects":false,"description":"HTTP/2 support for Express","version":"1.1.1","author":{"name":"Mark Jovis"},"contributors":[{"name":"grainrigi"}],"license":"MIT","keywords":["express","http2","https","push","support","compatibility","api","server"],"main":"src/index.js","scripts":{"createTypeFiles":"npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"peerDependencies":{"express":">=4.0.0"},"devDependencies":{"@eslint/js":"^10.0.1","eslint":"^10.5.0","globals":"^17.6.0"},"engines":{"node":">= 20.0.0"},"repository":{"type":"git","url":"git+https://github.com/markjovis/http2-express.git"},"bugs":{"url":"https://github.com/markjovis/http2-express/issues"},"homepage":"https://github.com/markjovis/http2-express#readme","gitHead":"8f9db944c5b7a418b8371c44ab2f00af1da5d74c","_id":"http2-express@1.1.1","_nodeVersion":"25.2.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-iROf3EIQdJZLNk+/LTkENZp1WB8B+IrYT+z/TPP3/RyGk6w9P9QZNDvs/lo5zAOozNuNYdHewIyWVXXAkBGQ7g==","shasum":"769a0b25f47d3358687c47a124e75ec33329594a","tarball":"https://registry.npmjs.org/http2-express/-/http2-express-1.1.1.tgz","fileCount":9,"unpackedSize":14783,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCv+M6kITVJsoJQKfMge1uCAD1DTc7XxqGpBljSJMQM/gIgPPp0VRefNJhjJLbptIrzbFCzvVJ22OPo6PaxYMc7OaQ="}]},"_npmUser":{"name":"markjovis","email":"mark.jovis@hotmail.com"},"directories":{},"maintainers":[{"name":"markjovis","email":"mark.jovis@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http2-express_1.1.1_1781759871276_0.25103750139546155"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-04T00:54:05.443Z","modified":"2026-06-18T05:17:51.557Z","1.0.0":"2024-11-04T00:54:05.633Z","1.0.1":"2024-12-19T04:25:17.040Z","1.1.0":"2025-09-18T00:01:41.165Z","1.1.1":"2026-06-18T05:17:51.423Z"},"bugs":{"url":"https://github.com/markjovis/http2-express/issues"},"author":{"name":"Mark Jovis"},"license":"MIT","homepage":"https://github.com/markjovis/http2-express#readme","keywords":["express","http2","https","push","support","compatibility","api","server"],"repository":{"type":"git","url":"git+https://github.com/markjovis/http2-express.git"},"description":"HTTP/2 support for Express","contributors":[{"name":"grainrigi"}],"maintainers":[{"name":"markjovis","email":"mark.jovis@hotmail.com"}],"readme":"# http2-express\nThis package adds HTTP/2 support to express.js applications.\n\n**Version 1.1.1** Fixes the following bugs:\n1. Fixed the crash issue when a stream is already destroyed.\n2. Removed the side-effecting hostname getter that mutated this.headers['host']. The host header is now initialized once, upfront, in middleware.\n3. Wrapped Object.setPrototypeOf calls in try/catch so errors go to next(err) instead of hanging the request.\n4. Express5 detection now uses parseInt(express.version, 10) >= 5 with the old heuristic as fallback. No longer breaks if lazyrouter is monkey-patched.\n5. Removed response.push = () => {} which mutated the shared Express prototype; push no-ops are now set only on app._response and app.http2Response.\n6. Added headers['host'] initialization in the Express 5 router middleware.\n7. If Express is not installed in your project, or your installed Express version is below version 4.0.0, you'll get a warning.\n<br>\n<br>\n\n**Version 1.1.0** adds support for **EXPRESS 5**. [grainrigi](https://github.com/grainrigi) was able to make the changes necessary to support **EXPRESS 5**.\nThis version is also backward compatible with Express 4.\n<br>\n<br>\n\n**Version 1.0.1** fixes an issue with h2c (running HTTP/2 without TLS) as reported by rickardkarlsson. You should now be able to create a non https server (http2.createServer.....) without any issues.\n<br>\n<br>\n\n**NOTICE**: This package is fully compatible with the old [http2-express-bridge](https://www.npmjs.com/package/http2-express-bridge). You should be able to replace the old package [http2-express-bridge](https://www.npmjs.com/package/http2-express-bridge) with this new one (\"**http2-express**\") without changing anything in your code, except the package name in the import (see usage below).\n\n## Installation\n```bash\nnpm i http2-express\n```\n\n**Notice**: It is recommended to use Node.js **version 19** or higher.\n\n    \n## Usage\n```javascript\nconst express = require('express');\nconst http2 = require('http2');\nconst http2Express = require('http2-express');\nconst fs = require('fs');\n\nconst app = http2Express(express);\n\napp.get('/', (req, res) => {\n  res.send('Hello World!');\n});\n\nconst options = {\n  key: fs.readFileSync('path to your certificate key'),\n  cert: fs.readFileSync('path to your certificate'),\n  passphrase: 'your certificate passphrase',\n  allowHTTP1: false\n};\n\nconst server = http2.createSecureServer(options, app);\n\nserver.listen(44320, () => {\n  console.info('Listening on port 44320...');\n});\n\n```\nThe code above creates an HTTP/2 server. An HTTP/2 server performs better than the older HTTP/1.1.\n\n**Notice**: If option property \"allowHTTP1\" is set to true, then your server will be backward compatible with HTTP/1.1. If false, then only the new HTTP/2 is supported. Browsers and HTTP Clients that don't support HTTP/2 will error out if \"allowHTTP1\" is false.\n\nESModule \"import\" syntax is also supported.\n\n**NOTICE**: While the old [http2-express-bridge](https://www.npmjs.com/package/http2-express-bridge) provided support for Server Push, this package does not support Server Push because all major browsers and HTTP/2 Clients no longer support it. For example, Server Push has been disable in Chrome since version 106. The reason behind it is that Server Push did not provide significant performance gains, and in many cases, the performance actually decreased.\n\n","readmeFilename":"README.md"}