{"name":"shot","description":"Injects a fake HTTP request/response into a node HTTP server","version":"3.5.2","repository":{"type":"git","url":"git://github.com/hapijs/shot.git"},"engines":{"node":">=6.0.0"},"main":"lib/index.js","keywords":["utilities","http","debug","test"],"dependencies":{"hoek":"4.x.x","joi":"12.x.x"},"devDependencies":{"code":"4.x.x","lab":"14.x.x"},"scripts":{"test":"lab -a code -t 100 -L -l","test-cov-html":"lab -a code -r html -o coverage.html -L -l"},"license":"SEE LICENSE IN LICENSE.md","_id":"shot@3.5.2","readme":"# shot\n\nInjects a fake HTTP request/response into a node HTTP server for simulating server logic, writing tests, or debugging. Does not use a socket\nconnection so can be run against an inactive server (server not in listen mode).\n\n[![Build Status](https://travis-ci.org/hapijs/shot.svg?branch=v3-commercial)](https://travis-ci.org/hapijs/shot)\n\n## Example\n\n```javascript\n// Load modules\n\nconst Http = require(\"http\");\nconst Shot = require(\"shot\");\n\n// Declare internals\n\nconst internals = {};\n\ninternals.main = function () {\n  const dispatch = function (req, res) {\n    const reply = \"Hello World\";\n    res.writeHead(200, {\n      \"Content-Type\": \"text/plain\",\n      \"Content-Length\": reply.length,\n    });\n    res.end(reply);\n  };\n\n  const server = Http.createServer(dispatch);\n\n  Shot.inject(dispatch, { method: \"get\", url: \"/\" }, (res) => {\n    console.log(res.payload);\n  });\n};\n\ninternals.main();\n```\n\nNote how `server.listen` is never called.\n\n## API\n\nSee the [API Reference](API.md)\n","readmeFilename":"README.md","gitHead":"04f17634faa0697a14052ec685665a95fa00ad76","bugs":{"url":"https://github.com/hapijs/shot/issues"},"homepage":"https://github.com/hapijs/shot#readme","_nodeVersion":"18.18.1","_npmVersion":"10.2.1","dist":{"integrity":"sha512-5IBT7mmyi2XWGh0qY2zH8bixmWPuPVG5QtWDm9dt2pxEufA3t4MUA99ZIdG3e4RdcVLeg2fZvoh+8R8qg1m6BQ==","shasum":"cccf109e492abc9c80cfac89a87d3e0e9ef8a1cf","tarball":"http://registry-npm.ywwl.com/shot/download/shot-3.5.2.tgz","fileCount":8,"unpackedSize":11895,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDj3qOkNbVhojy6yoXFCFKB5jInE4gRdk/DPGZPEb4y3gIhAIWEn2O9EqLMoXU2SBAG9TEJZod58JO6Lrdkv8XV34dE"}],"size":4091,"noattachment":false,"key":"/shot/-/shot-3.5.2.tgz"},"_npmUser":{"name":"nargonath","email":"jonas.pauthier@gmail.com"},"directories":{},"maintainers":[{"name":"nargonath","email":"jonas.pauthier@gmail.com"},{"name":"devinivy","email":"devinivy@gmail.com"},{"name":"marsup","email":"nicolas@morel.io"},{"name":"nlf","email":"quitlahok@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shot_3.5.2_1704533862545_0.0772118333189078"},"_hasShrinkwrap":false,"deprecated":"This module has moved and is now available at @hapi/shot. Please update your dependencies as this version is no longer maintained and may contain bugs and security issues.","publish_time":1704533862700,"_cnpm_publish_time":1704533862700,"dist-tags":{"latest":"4.0.7","v3-legacy":"3.5.2"}}