{"_id":"turbo-http","_rev":"10-4a96f095185a9171a40634eb7d41b6e4","name":"turbo-http","dist-tags":{"latest":"0.3.2"},"versions":{"0.0.0":{"name":"turbo-http","version":"0.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","_id":"turbo-http@0.0.0","_shasum":"eef713dce2b510bcb23fd7440d8a3e3d71332b69","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"ricardofbarros","email":"ricardofbarros@hotmail.com"},"dist":{"shasum":"eef713dce2b510bcb23fd7440d8a3e3d71332b69","tarball":"https://registry.npmjs.org/turbo-http/-/turbo-http-0.0.0.tgz","integrity":"sha512-HpdAbdpf9wbZAhJ6vLPJOHVI6zLqRcniT7cWFhy0kEk3ii4ao8vQ4KbtCfzbmKHg8mc0MtTERaCYDqEwlRUibw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUQJQ7gid7qezwJ/rE5LByq3kvuA8KFeXf9N35eTKAIAIgCL7V/tQZjY7BFx5EgUaNgsvIukE+FV4sXjxeCANIFdI="}]},"maintainers":[{"name":"ricardofbarros","email":"ricardofbarros@hotmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/turbo-http-0.0.0.tgz_1486999162039_0.7792387055233121"},"directories":{}},"0.1.1":{"name":"turbo-http","version":"0.1.1","description":"Blazing fast low level http server","main":"index.js","dependencies":{"http-parser-js":"^0.4.10","turbo-net":"^1.2.1"},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/turbo-http.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/turbo-http/issues"},"homepage":"https://github.com/mafintosh/turbo-http","gitHead":"4b17cda080639f3326d45a4fa38ff0435a3b59dd","_id":"turbo-http@0.1.1","_npmVersion":"5.6.0","_nodeVersion":"10.0.0-pre","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-sj3oTAWF+X+netCZf0vDAZeVROqdUTXY7jigX+PTdSxbyvCVB5m06533jM0JrO+JjzygQ1aa0erovpi4rfHGTw==","shasum":"9d48fc91f2cb3c813fcb8ee24747a6cf60fcb352","tarball":"https://registry.npmjs.org/turbo-http/-/turbo-http-0.1.1.tgz","fileCount":6,"unpackedSize":14716,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPzajCmu7AFVGOat+c+OPp2uaBbd0rrKc7wvLVu18hnwIhAMGjeOg0pelfhTUAoWXQHBBk1wP++lx6J8I05CdkR5ek"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/turbo-http_0.1.1_1520001958784_0.8559962662289875"},"_hasShrinkwrap":false},"0.2.0":{"name":"turbo-http","version":"0.2.0","description":"Blazing fast low level http server","main":"index.js","dependencies":{"http-parser-js":"^0.4.10","turbo-net":"^1.2.1"},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/turbo-http.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/turbo-http/issues"},"homepage":"https://github.com/mafintosh/turbo-http","gitHead":"45fb148dd52d71ab9cb0069c8c076a01328337f9","_id":"turbo-http@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-o+RxLKVVNBCCpF6fygbPEHj4zBpzpdPNeqX3amvLHWNxwNTu51KBeRQEnVUt9pOulVd20U9bLP8/QctoId8SAw==","shasum":"ba4b5810206a17c24948bd117b998471ef5ed22e","tarball":"https://registry.npmjs.org/turbo-http/-/turbo-http-0.2.0.tgz","fileCount":6,"unpackedSize":14828,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQbvgXzYNIKzXcYIieHU8hFGaqQIvJjOEPJ4hGELBrfQIhAOR0ABqC1QCMHHbCVLBc6VRSWIJ6QH5RV6epPJ/zP1gm"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/turbo-http_0.2.0_1520329036867_0.14714300819635073"},"_hasShrinkwrap":false},"0.3.0":{"name":"turbo-http","version":"0.3.0","description":"Blazing fast low level http server","main":"index.js","dependencies":{"http-parser-js":"^0.4.11","turbo-net":"^1.4.0"},"devDependencies":{"standard":"^11.0.0"},"scripts":{"test":"standard"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/turbo-http.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/turbo-http/issues"},"homepage":"https://github.com/mafintosh/turbo-http","gitHead":"274e709f7d8abb8d34d954a23cca782c694bcaf2","_id":"turbo-http@0.3.0","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-5ZR0GbfKGK4dSkTNRN3nJtXsptj9H/GU5e+MCiF5vMfqBoj6BdPSQKS19wY21Cekj7l/H3a8i8bZ0eOJ7803AQ==","shasum":"c4673c78e764fca260c197f9f33047f5cb3d3a3e","tarball":"https://registry.npmjs.org/turbo-http/-/turbo-http-0.3.0.tgz","fileCount":10,"unpackedSize":15441,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiDkdPHp9U5uZyJHst9uK84U9tl0X2SAOYqhq9qAeopAIhAPmFYkxI1d56l+tycUpHqDcWl7jl3Pt+MFi7tKf3Uclc"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/turbo-http_0.3.0_1521400785395_0.5662035277705011"},"_hasShrinkwrap":false},"0.3.2":{"name":"turbo-http","version":"0.3.2","description":"Blazing fast low level http server","main":"index.js","dependencies":{"http-parser-js":"^0.4.11","turbo-net":"^1.4.0"},"devDependencies":{"autocannon":"^2.4.1","chalk":"^2.4.1","cli-table":"^0.3.1","express":"^4.16.3","fastify":"^1.4.0","hapi":"^17.4.0","minimist":"^1.2.0","ora":"^2.1.0","polka":"^0.4.0","rayo":"^0.5.7","standard":"^11.0.0","tape":"^4.9.0"},"scripts":{"pretest":"npm run lint","bench":"node ./benchmarks","test":"tape test/*.js","lint":"standard"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/turbo-http.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/turbo-http/issues"},"homepage":"https://github.com/mafintosh/turbo-http","gitHead":"cacb2236155bbbf0d68407d673f10336b125debe","_id":"turbo-http@0.3.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-2sgHLek8aTTO5dPQ0B14FRrNnslmmD6osS9g0kRAhfxGSw/rClUFqtJO2LIo6QZwVD+QNvGNywGBc4Of9wbFtg==","shasum":"184a95dd0b8630d8e2e407ca1f0ddbdf69bc1838","tarball":"https://registry.npmjs.org/turbo-http/-/turbo-http-0.3.2.tgz","fileCount":9,"unpackedSize":17105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj5dwCRA9TVsSAnZWagAAJV4P/0GPgmjr8dnVjDOLMcT6\nyavD3UfcW29Z7feCg7XoP/KITxAeOXVV5vbS7cYpaLosGXt8xGkNZKrt3c+7\n3IhMc/vQAVQ2+/Bj/hWH3EtE3Hel92qopXxdW0YqOSKWS0n36CI/RoNiBRs0\nLo+bCpkyf63YJskcnbbXA8n1TW1k+bdr14brtf2FlWTOQTtTVfH+U17bBDV1\nNZkU1GoNBylf2yzdymAAGtgsSbSYt8yvBZzsgRnLoSiJDJjMcrxbR+Rru87H\nnAL8r6OiEHAurLaWHHzyt+lDyjHrYX/8kBna0T5lvp/+vr7vO2XlodqnzDL7\nJFMQZPjFxq8at7R5wxquCFyaGkP+Xaqao8j9elVLZsADN28bcTvcVXe5Shj+\nOZFNphAE+lLjJ7y8R0qIEGdHlQvqYOtHPLz328qpSkNu1/Qlks4UtNWMh5hc\neSCtTGPCGl3rldMVtCyfM5CKCNRexSZI2XE226F8LYq8bguDA+EGIpGCWIOB\nu1FDSqFipMUInV8KKaY1D3BZbg8kVNUcIEHGRVaCtrk1lBF5bOWcHcObYnOW\nbqsgOl1K66tvFIETK6bTNSptK99MdOJcwtyIs6RX6Rt7aEZ0ZYBgJua+4+vb\nXoZAxMu2qBwexejYnkISZUKhFm5s5Ojgzmw2kUm60mrpmMkmL3+0br88Kdo0\nMCdu\r\n=4cFQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8trWonmHOs3XPwPgyiszCBuFLA9o1wA2yAfpxQbog+AiEAkhiH8bMG4hRNTSDiilX4JaijULVxc/2TEwgqAVrNfnQ="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/turbo-http_0.3.2_1552914288307_0.39492833155523943"},"_hasShrinkwrap":false}},"readme":"# turbo-http\n\nA low level http library for Node.js based on [turbo-net](https://github.com/mafintosh/turbo-net)\n\n```\nnpm i turbo-http\n```\n\n[![build status](https://travis-ci.org/mafintosh/turbo-http.svg?branch=master)](https://travis-ci.org/mafintosh/turbo-http)\n\nWIP, this module is already *really* fast but there are some HTTP features\nmissing and easy performance gains to be had. :D :D :D\n\nOn my laptop I can serve simple hello world payloads at around 100k requests/seconds compared to 10k requests/second using node core.\n\n## Usage\n\n``` js\nconst turbo = require('turbo-http')\n\nconst server = turbo.createServer(function (req, res) {\n  res.setHeader('Content-Length', '11')\n  res.write(Buffer.from('hello world'))\n})\n\nserver.listen(8080)\n```\n\n## API\n\n#### `server = turbo.createServer([onrequest])`\n\nCreate a new http server. Inherits from [the turbo-net tcp server](https://github.com/mafintosh/turbo-net#server--turbocreateserveroptions-onsocket)\n\n#### `server.on('request', req, res)`\n\nEmitted when a new http request is received.\n\n#### `res.statusCode = code`\n\nSet the http status\n\n#### `res.setHeader(name, value)`\n\nSet a http header\n\n#### `res.write(buf, [length], [callback])`\n\nWrite a buffer. When the callback is called, the buffer\nhas been *completely* flushed to the underlying socket and is safe to\nreuse for other purposes\n\n#### `res.writev(buffers, [lengths], [callback])`\n\nWrite more that one buffer at once.\n\n#### `res.end([buf], [length], [callback]`)\n\nEnd the request. Only needed if you do not provide a `Content-Length`.\n\n#### `req.url`\n\nRequest url\n\n#### `req.method`\n\nRequest method\n\n#### `req.socket`\n\nRequest [turbo-net](https://github.com/mafintosh/turbo-net) socket\n\n#### `value = req.getHeader(name)`\n\nGet a request header.\n\n#### `headers = req.getAllHeaders()`\n\nGet all request headers as a map.\n\n#### `req.ondata(buffer, start, length)`\n\nCalled when there is data read. If you use the buffer outside of this function\nyou should copy it.\n\n#### `req.onend()`\n\nCalled when the request is fully read.\n\n\n## Benchmarks\n\nComparing `turbo-http` to other frameworks is like comparing oranges to apples.\n`turbo-http` could be thought of as a replacement of Node's native [http](https://nodejs.org/api/http.html) module, while all available frameworks actually use it.\n\nBenchmark it:\n- `clone this repo`,\n- `npm i`\n- `npm run bench`\n\nBenchmark averages are taken after one warm-up round.\n\n&nbsp;        | Requests/s | Latency | Throughput/Mb\n------------- | ---------- | ------- | --------------\nturbo-http.js | 32592      | 3.03    | 2.43\nbare-node.js  | 18396      | 5.32    | 1.98\nrayo.js       | 16249.6    | 6.03    | 1.77\npolka.js      | 15802.4    | 6.2     | 1.71\nfastify.js    | 15141.6    | 6.47    | 2.26\nexpress.js    | 13408.8    | 7.31    | 1.46\nhapi.js       | 9675.6     | 10.15   | 1.42\n\n> **Note:** Nevermind these numbers, this benchmark was run on a slow computer and the above table is for illustrative purposes only.\n\nOptionally, you may also define your test's parameters:\n```\n$> npm run bench -- -u http://localhost:5050 -c 100 -p 10 -d 5\n```\n* `-u` (_url_) -Defaults to `http://localhost:5050`\n* `-c` (_connections_) -Defaults to `100`\n* `-p` (_pipelines_) -Defaults to `10`\n* `-d` (_duration_) -Defaults to `5` (seconds)\n\n\n## Acknowledgements\n\nThis project was kindly sponsored by [nearForm](http://nearform.com).\n\n## License\n\nMIT\n","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"time":{"modified":"2022-06-27T23:24:37.236Z","created":"2017-02-13T15:19:23.893Z","0.0.0":"2017-02-13T15:19:23.893Z","0.1.1":"2018-03-02T14:45:58.853Z","0.2.0":"2018-03-06T09:37:16.938Z","0.3.0":"2018-03-18T19:19:45.478Z","0.3.2":"2019-03-18T13:04:48.465Z"},"license":"MIT","readmeFilename":"README.md","description":"Blazing fast low level http server","homepage":"https://github.com/mafintosh/turbo-http","repository":{"type":"git","url":"git+https://github.com/mafintosh/turbo-http.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/turbo-http/issues"}}