{"_id":"@crabas0npm/voluptate-adipisci-et","name":"@crabas0npm/voluptate-adipisci-et","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@crabas0npm/voluptate-adipisci-et","version":"1.0.0","description":"![CI](https://github.com/crabas0npm/voluptate-adipisci-et/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/@crabas0npm/voluptate-adipisci-et.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/voluptate-adipisci-et) [![js-standa","main":"index.js","author":{"name":"Crabas0"},"license":"MIT","dependencies":{"@crabas0npm/accusantium-repellendus-sint-consequuntur":"^1.0.0","@crabas0npm/alias-consequuntur-hic-enim":"^1.0.0","@crabas0npm/aliquid-vitae-magnam-perspiciatis":"^1.0.0","@crabas0npm/aut-cupiditate-quam-dicta":"^1.0.0","@crabas0npm/blanditiis-est-molestias-a":"^1.0.0","@crabas0npm/consectetur-impedit-exercitationem-error":"^1.0.0","@crabas0npm/corporis-rerum-reprehenderit-voluptates":"^1.0.0","@crabas0npm/delectus-dolorem-consectetur-corrupti":"^1.0.0","@crabas0npm/ea-nisi-earum-mollitia":"^1.0.0","@crabas0npm/et-perspiciatis-eius-modi":"^1.0.0","@crabas0npm/expedita-magnam-quia-perferendis":"^1.0.0","@crabas0npm/expedita-optio-recusandae-nesciunt":"^1.0.0","@crabas0npm/expedita-voluptas-corrupti-ullam":"^1.0.0","@crabas0npm/facilis-doloribus-provident-optio":"^1.0.0","@crabas0npm/fugiat-necessitatibus-recusandae-quo":"^1.0.0","@crabas0npm/maxime-sequi-nam-facere":"^1.0.0","@crabas0npm/minus-iure-ipsum-temporibus":"^1.0.0","@crabas0npm/nulla-minima-vero-facere":"^1.0.0","@crabas0npm/odio-exercitationem-ducimus-provident":"^1.0.0","@crabas0npm/officia-nostrum-at-hic":"^1.0.0","@crabas0npm/officiis-labore-tempora-sint":"^1.0.0","@crabas0npm/omnis-neque-asperiores-rerum":"^1.0.0","@crabas0npm/optio-sequi-optio-quidem":"^1.0.0","@crabas0npm/porro-voluptatem-consectetur-beatae":"^1.0.0","@crabas0npm/possimus-sit-repellat-perspiciatis":"^1.0.0","@crabas0npm/quo-dolorem-molestiae-porro":"^1.0.0","@crabas0npm/ratione-nisi-deleniti-provident":"^1.0.0","@crabas0npm/ratione-voluptatibus-quo-sed":"^1.0.0","@crabas0npm/repellendus-illum-cum-fugit":"^1.0.0","@crabas0npm/unde-quos-asperiores-modi":"^1.0.0","@diahkomalasarinpm/praesentium-sint-dolorem":"^1.0.0","@f1stnpm2/adipisci-adipisci-praesentium":"^1.0.0","@wemnyelezxnpm/delectus-repellendus-neque":"^1.0.0"},"keywords":["slice","packages","less","language","is","fast","nope","resolve","hooks","app","argparse","uuid","persistent","compare","macos","buffer","form","mime-db","write","sameValueZero","ajv","wrap","hash","forms","curl","pose","sigterm","TypeScript","spec","computed-types","ansi","style","ECMAScript 6","trimRight","throat","make","Push","debug","asserts","ES2018","generics","dotenv","toolkit","install","whatwg","arguments","Function.prototype.name","robust","redux-toolkit","react-hooks","view","pretty","RxJS","tap","BigInt64Array","descriptor","ender","speed","exec","tacit","three","default","ECMAScript 2019","Object.keys","sanitization","transpiler","modules","helpers","Underscore","class-validator","performant","trimStart","querystring","find","dir","Int32Array","trim","protobuf","call-bind","Array.prototype.findLastIndex","compiler","deep-clone","WebSockets","rm","user-streams","duplex","offset","monorepo","wordbreak","get","mkdirp","ES2023","3d","syntax","ES2017","pure","signal","react animation","parents","syntaxerror","installer","escape","ReactiveX","react pose","typesafe","ie","utility","jsonschema","ava","tape","irq","Array","regex","yaml","module","es2016","dataView","Object","gdpr","call","status","opener","jQuery","bundler","deep","set","airbnb","interrupts","copy","zod","watch","babel-core","byteOffset","typedarrays","object","open","immutable","break","idle","data","jsdiff","look-up","RegExp.prototype.flags","search","xdg","eventDispatcher","package manager","waapi","Reflect.getPrototypeOf","callbound","flatten","less css","console","utilities","toobject","react","east-asian-width","higher-order","uninstall","collection","typed array","type","look","argv","length","exit","eslint","date","less mixins","streams2","delete","variables in css","fastify","create","fixed-width","hasOwn","jsdom","unicode","typed","optimizer","json-schema","curried","regexp","limited","Symbol","prune","package.json","spawn","es-shims","once","encryption","isConcatSpreadable","styles","xhr","stable","symbol","eslint-plugin","Map","check","schema","gradients css3","accessor","art","code points","preprocessor","concatMap","guid","Streams","structuredClone","redact","queue","polyfill","flag","command-line","ascii","StyleSheet","RFC-6455","util.inspect","number","Array.prototype.contains","Object.values","shared","BigUint64Array","import","utils","var","clone","start","signals","loading","Array.prototype.flatMap","rgb","fast-clone","Symbol.toStringTag","less compiler","random","key","arrays","immer","defineProperty","ECMAScript 2015","jasmine","libphonenumber","last","connect","inspect","ECMAScript 3","invariant","reducer","Rx","npm","getter","command","dayjs","es2015","buffers","stylesheet","up","HyBi","inference","drop","wget","progress","ReactiveExtensions","filter","term","wait","value","fast-deep-copy","metadata","iterator","deep-copy","urls","child","group","watcher","pyyaml","jest","es2018","debugger","task","require","TypeBox","negative","WebSocket","listeners","real-time","Promise","mixins","link","touch","array","every","ecmascript","sorted","classname","assign","gestures","ECMAScript 2022","eslintplugin","Stream","JSON-Schema","symlink","bootstrap less","superstruct","fetch","extra","spinner","ES2021","stdlib","express","make dir","config","japanese","slot","jsx","proto","ES2016","Uint8Array","Uint32Array","getOwnPropertyDescriptor","json-schema-validation","[[Prototype]]","operating-system","path","browser","wordwrap","native","callbind","regular expressions","ArrayBuffer","internal slot","arktype","error-handling","watching","tools","weakset","rm -fr","functional","tostringtag","which","positive","ES5","css variable","datastructure","reduce","includes","runtime","tdd","rangeerror","eventEmitter","lazy","flatMap","react-hook-form","channel","variables","entries","deterministic","parser","lesscss","matchAll","expression","mime","byteLength","launch","busy","regular","l10n","validate","cache","serializer","protocol-buffers","private data","javascript","form-validation","url","awesomesauce","deepcopy","ECMAScript 2018","promises","scheme","sequence","bundling","linewrap","es","point-free","testing","opens","fastcopy","crypt","dependencies","traverse","commander","web","browserlist","framer","phone","auth","patch","flags","http","graphql","arraybuffer","emoji","browserslist","plugin","handlers","ArrayBuffer#slice","lockfile","ES2020","option","Array.prototype.flat","args","classnames","zero","mobile","URLSearchParams","AsyncIterator","es2017","ES","validation","limit","ES2022","parse","sigint","names","concat","stream","less.js","extend","byte","electron","settings","negative zero","input","exe","core","toArray","cmd","ES7","toSorted","Object.getPrototypeOf","accessibility"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/voluptate-adipisci-et.git"},"homepage":"https://github.com/crabas0npm/voluptate-adipisci-et/#readme","bugs":{"url":"https://github.com/crabas0npm/voluptate-adipisci-et/issues"},"packageManager":"yarn@4.1.1","_id":"@crabas0npm/voluptate-adipisci-et@1.0.0","gitHead":"1b5a0c4aef17deba676b9e0383cc006eff809a0e","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-CHiCaJDbM4BIOJPsR/rk0LddOmaSATMR1MF/crRk+TYZe4I/01qz+Uq86uqXeafaF6LDyu6DQ0MOAPZkJai2mw==","shasum":"dd52f19a9e00d8ae2a907f18bd1d5d5b83affbde","tarball":"https://registry.npmjs.org/@crabas0npm/voluptate-adipisci-et/-/voluptate-adipisci-et-1.0.0.tgz","fileCount":10,"unpackedSize":24458,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFRdtLgX/Eh4j67snX4CCk+iqYXj+ybHv0TSNzUr5PKfAiBo9DBE5/UsYynriAdbZacs59UdXMddShwlxcdn9FC33w=="}]},"_npmUser":{"name":"thanhl4861","email":"thanhl4861@gmail.com"},"directories":{},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/voluptate-adipisci-et_1.0.0_1714117493757_0.24706984938516086"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-26T07:44:53.618Z","1.0.0":"2024-04-26T07:44:53.884Z","modified":"2024-04-26T07:44:54.163Z"},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"description":"![CI](https://github.com/crabas0npm/voluptate-adipisci-et/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/@crabas0npm/voluptate-adipisci-et.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/voluptate-adipisci-et) [![js-standa","homepage":"https://github.com/crabas0npm/voluptate-adipisci-et/#readme","keywords":["slice","packages","less","language","is","fast","nope","resolve","hooks","app","argparse","uuid","persistent","compare","macos","buffer","form","mime-db","write","sameValueZero","ajv","wrap","hash","forms","curl","pose","sigterm","TypeScript","spec","computed-types","ansi","style","ECMAScript 6","trimRight","throat","make","Push","debug","asserts","ES2018","generics","dotenv","toolkit","install","whatwg","arguments","Function.prototype.name","robust","redux-toolkit","react-hooks","view","pretty","RxJS","tap","BigInt64Array","descriptor","ender","speed","exec","tacit","three","default","ECMAScript 2019","Object.keys","sanitization","transpiler","modules","helpers","Underscore","class-validator","performant","trimStart","querystring","find","dir","Int32Array","trim","protobuf","call-bind","Array.prototype.findLastIndex","compiler","deep-clone","WebSockets","rm","user-streams","duplex","offset","monorepo","wordbreak","get","mkdirp","ES2023","3d","syntax","ES2017","pure","signal","react animation","parents","syntaxerror","installer","escape","ReactiveX","react pose","typesafe","ie","utility","jsonschema","ava","tape","irq","Array","regex","yaml","module","es2016","dataView","Object","gdpr","call","status","opener","jQuery","bundler","deep","set","airbnb","interrupts","copy","zod","watch","babel-core","byteOffset","typedarrays","object","open","immutable","break","idle","data","jsdiff","look-up","RegExp.prototype.flags","search","xdg","eventDispatcher","package manager","waapi","Reflect.getPrototypeOf","callbound","flatten","less css","console","utilities","toobject","react","east-asian-width","higher-order","uninstall","collection","typed array","type","look","argv","length","exit","eslint","date","less mixins","streams2","delete","variables in css","fastify","create","fixed-width","hasOwn","jsdom","unicode","typed","optimizer","json-schema","curried","regexp","limited","Symbol","prune","package.json","spawn","es-shims","once","encryption","isConcatSpreadable","styles","xhr","stable","symbol","eslint-plugin","Map","check","schema","gradients css3","accessor","art","code points","preprocessor","concatMap","guid","Streams","structuredClone","redact","queue","polyfill","flag","command-line","ascii","StyleSheet","RFC-6455","util.inspect","number","Array.prototype.contains","Object.values","shared","BigUint64Array","import","utils","var","clone","start","signals","loading","Array.prototype.flatMap","rgb","fast-clone","Symbol.toStringTag","less compiler","random","key","arrays","immer","defineProperty","ECMAScript 2015","jasmine","libphonenumber","last","connect","inspect","ECMAScript 3","invariant","reducer","Rx","npm","getter","command","dayjs","es2015","buffers","stylesheet","up","HyBi","inference","drop","wget","progress","ReactiveExtensions","filter","term","wait","value","fast-deep-copy","metadata","iterator","deep-copy","urls","child","group","watcher","pyyaml","jest","es2018","debugger","task","require","TypeBox","negative","WebSocket","listeners","real-time","Promise","mixins","link","touch","array","every","ecmascript","sorted","classname","assign","gestures","ECMAScript 2022","eslintplugin","Stream","JSON-Schema","symlink","bootstrap less","superstruct","fetch","extra","spinner","ES2021","stdlib","express","make dir","config","japanese","slot","jsx","proto","ES2016","Uint8Array","Uint32Array","getOwnPropertyDescriptor","json-schema-validation","[[Prototype]]","operating-system","path","browser","wordwrap","native","callbind","regular expressions","ArrayBuffer","internal slot","arktype","error-handling","watching","tools","weakset","rm -fr","functional","tostringtag","which","positive","ES5","css variable","datastructure","reduce","includes","runtime","tdd","rangeerror","eventEmitter","lazy","flatMap","react-hook-form","channel","variables","entries","deterministic","parser","lesscss","matchAll","expression","mime","byteLength","launch","busy","regular","l10n","validate","cache","serializer","protocol-buffers","private data","javascript","form-validation","url","awesomesauce","deepcopy","ECMAScript 2018","promises","scheme","sequence","bundling","linewrap","es","point-free","testing","opens","fastcopy","crypt","dependencies","traverse","commander","web","browserlist","framer","phone","auth","patch","flags","http","graphql","arraybuffer","emoji","browserslist","plugin","handlers","ArrayBuffer#slice","lockfile","ES2020","option","Array.prototype.flat","args","classnames","zero","mobile","URLSearchParams","AsyncIterator","es2017","ES","validation","limit","ES2022","parse","sigint","names","concat","stream","less.js","extend","byte","electron","settings","negative zero","input","exe","core","toArray","cmd","ES7","toSorted","Object.getPrototypeOf","accessibility"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/voluptate-adipisci-et.git"},"author":{"name":"Crabas0"},"bugs":{"url":"https://github.com/crabas0npm/voluptate-adipisci-et/issues"},"license":"MIT","readme":"# Light my Request\n\n![CI](https://github.com/crabas0npm/voluptate-adipisci-et/workflows/CI/badge.svg)\n[![NPM version](https://img.shields.io/npm/v/@crabas0npm/voluptate-adipisci-et.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/voluptate-adipisci-et)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)\n\nInjects a fake HTTP request/response into a node HTTP server for simulating server logic, writing tests, or debugging.\nDoes not use a socket connection so can be run against an inactive server (server not in listen mode).\n\n## Example\n\n```javascript\nconst http = require('node:http')\nconst inject = require('@crabas0npm/voluptate-adipisci-et')\n\nconst dispatch = function (req, res) {\n  const reply = 'Hello World'\n  res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': reply.length })\n  res.end(reply)\n}\n\nconst server = http.createServer(dispatch)\n\ninject(dispatch, { method: 'get', url: '/' }, (err, res) => {\n  console.log(res.payload)\n})\n```\nNote how `server.listen` is never called.\n\nAsync await and promises are supported as well!\n```javascript\n// promises\ninject(dispatch, { method: 'get', url: '/' })\n  .then(res => console.log(res.payload))\n  .catch(console.log)\n\n// async-await\ntry {\n  const res = await inject(dispatch, { method: 'get', url: '/' })\n  console.log(res.payload)\n} catch (err) {\n  console.log(err)\n}\n```\n\nYou can also use chaining methods if you do not pass the callback function. Check [here](#method-chaining) for details.\n\n```js\n// chaining methods\ninject(dispatch)\n  .get('/')                   // set the request method to GET, and request URL to '/'\n  .headers({ foo: 'bar' })    // set the request headers\n  .query({ foo: 'bar' })      // set the query parameters\n  .end((err, res) => {\n    console.log(res.payload)\n  })\n\ninject(dispatch)\n  .post('/')                  // set the request method to POST, and request URL to '/'\n  .payload('request payload') // set the request payload\n  .body('request body')       // alias for payload\n  .end((err, res) => {\n    console.log(res.payload)\n  })\n\n// async-await is also supported\ntry {\n  const chain = inject(dispatch).get('/')\n  const res = await chain.end()\n  console.log(res.payload)\n} catch (err) {\n  console.log(err)\n}\n```\n\nFile uploads (`multipart/form-data`) or form submit (`x-www-form-urlencoded`) can be achieved by using [form-auto-content](https://github.com/Eomm/form-auto-content) package as shown below:\n\n```js\nconst formAutoContent = require('form-auto-content')\nconst fs = require('node:fs')\n\ntry {\n  const form = formAutoContent({\n    myField: 'hello',\n    myFile: fs.createReadStream(`./path/to/file`)\n  })\n\n  const res = await inject(dispatch, {\n    method: 'post',\n    url: '/upload',\n    ...form\n  })\n  console.log(res.payload)\n} catch (err) {\n  console.log(err)\n}\n```\n\nThis module ships with a handwritten TypeScript declaration file for TS support. The declaration exports a single namespace `LightMyRequest`. You can import it one of two ways:\n```typescript\nimport * as LightMyRequest from '@crabas0npm/voluptate-adipisci-et'\n\nconst dispatch: LightMyRequest.DispatchFunc = function (req, res) {\n  const reply = 'Hello World'\n  res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': reply.length })\n  res.end(reply)\n}\n\nLightMyRequest.inject(dispatch, { method: 'get', url: '/' }, (err, res) => {\n  console.log(res.payload)\n})\n\n// or\nimport { inject, DispatchFunc } from '@crabas0npm/voluptate-adipisci-et'\n\nconst dispatch: DispatchFunc = function (req, res) {\n  const reply = 'Hello World'\n  res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': reply.length })\n  res.end(reply)\n}\n\ninject(dispatch, { method: 'get', url: '/' }, (err, res) => {\n  console.log(res.payload)\n})\n```\nThe declaration file exports types for the following parts of the API:\n- `inject` - standard @crabas0npm/voluptate-adipisci-et `inject` method\n- `DispatchFunc` - the fake HTTP dispatch function\n- `InjectPayload` - a union type for valid payload types\n- `isInjection` - standard @crabas0npm/voluptate-adipisci-et `isInjection` method\n- `InjectOptions` - options object for `inject` method\n- `Request` - custom @crabas0npm/voluptate-adipisci-et `request` object interface. Extends\n  Node.js `stream.Readable` type by default. This behavior can be changed by\n  setting the `Request` option in the `inject` method's options\n- `Response` - custom @crabas0npm/voluptate-adipisci-et `response` object interface. Extends Node.js `http.ServerResponse` type\n\n## API\n\n#### `inject(dispatchFunc[, options, callback])`\n\nInjects a fake request into an HTTP server.\n\n- `dispatchFunc` - listener function. The same as you would pass to `Http.createServer` when making a node HTTP server. Has the signature `function (req, res)` where:\n    - `req` - a simulated request object. Inherits from `Stream.Readable` by\n      default. Optionally inherits from another class, set in\n      `options.Request`\n    - `res` - a simulated response object. Inherits from node's `Http.ServerResponse`.\n- `options` - request options object where:\n  - `url` | `path` - a string specifying the request URL.\n  - `method` - a string specifying the HTTP request method, defaulting to `'GET'`.\n  - `authority` - a string specifying the HTTP HOST header value to be used if no header is provided, and the `url`\n    does not include an authority component. Defaults to `'localhost'`.\n  - `headers` - an optional object containing request headers.\n  - `cookies` - an optional object containing key-value pairs that will be encoded and added to `cookie` header. If the header is already set, the data will be appended.\n  - `remoteAddress` - an optional string specifying the client remote address. Defaults to `'127.0.0.1'`.\n  - `payload` - an optional request payload. Can be a string, Buffer, Stream or object. If the payload is string, Buffer or Stream is used as is as the request payload. Oherwise it is serialized with `JSON.stringify` forcing the request to have the `Content-type` equal to `application/json`\n  - `query` - an optional object or string containing query parameters.\n  - `body` - alias for payload.\n  - `simulate` - an object containing flags to simulate various conditions:\n    - `end` - indicates whether the request will fire an `end` event. Defaults to `undefined`, meaning an `end` event will fire.\n    - `split` - indicates whether the request payload will be split into chunks. Defaults to `undefined`, meaning payload will not be chunked.\n    - `error` - whether the request will emit an `error` event. Defaults to `undefined`, meaning no `error` event will be emitted. If set to `true`, the emitted error will have a message of `'Simulated'`.\n    - `close` - whether the request will emit a `close` event. Defaults to `undefined`, meaning no `close` event will be emitted.\n  - `validate` - Optional flag to validate this options object. Defaults to `true`.\n  - `server` - Optional http server. It is used for binding the `dispatchFunc`.\n  - `autoStart` - Automatically start the request as soon as the method\n    is called. It is only valid when not passing a callback. Defaults to `true`.\n  - `signal` - An `AbortSignal` that may be used to abort an ongoing request. Requires Node v16+.\n  - `Request` - Optional type from which the `request` object should inherit\n    instead of `stream.Readable`\n- `callback` - the callback function using the signature `function (err, res)` where:\n  - `err` - error object\n  - `res` - a response object where:\n    - `raw` - an object containing the raw request and response objects where:\n      - `req` - the simulated request object.\n      - `res` - the simulated response object.\n    - `headers` - an object containing the response headers.\n    - `statusCode` - the HTTP status code.\n    - `statusMessage` - the HTTP status message.\n    - `payload` - the payload as a UTF-8 encoded string.\n    - `body` - alias for payload.\n    - `rawPayload` - the raw payload as a Buffer.\n    - `trailers` - an object containing the response trailers.\n    - `json` - a function that parses a json response payload and returns an object.\n    - `stream` - a function that provides a `Readable` stream of the response payload.\n    - `cookies` - a getter that parses the `set-cookie` response header and returns an array with all the cookies and their metadata.\n\nNotes:\n\n- You can also pass a string in place of the `options` object as a shorthand\n  for `{url: string, method: 'GET'}`.\n- Beware when using the `Request` option. That might make _@crabas0npm/voluptate-adipisci-et_\n  slower. Sample benchmark result run on an i5-8600K CPU with `Request` set to\n  `http.IncomingMessage`:\n\n```\nRequest x 155,018 ops/sec ±0.47% (94 runs sampled)\nCustom Request x 30,373 ops/sec ±0.64% (90 runs sampled)\nRequest With Cookies x 125,696 ops/sec ±0.29% (96 runs sampled)\nRequest With Cookies n payload x 114,391 ops/sec ±0.33% (97 runs sampled)\nParseUrl x 255,790 ops/sec ±0.23% (99 runs sampled)\nParseUrl and query x 194,479 ops/sec ±0.16% (99 runs sampled)\n```\n\n#### `inject.isInjection(obj)`\n\nChecks if given object `obj` is a *@crabas0npm/voluptate-adipisci-et* `Request` object.\n\n#### Method chaining\n\nThere are following methods you can used as chaining:\n- `delete`, `get`, `head`, `options`, `patch`, `post`, `put`, `trace`. They will set the HTTP request method and the request URL.\n- `body`, `headers`, `payload`, `query`, `cookies`. They can be used to set the request options object.\n\nAnd finally you need to call `end`. It has the signature `function (callback)`.\nIf you invoke `end` without a callback function, the method will return a promise, thus you can:\n\n```js\nconst chain = inject(dispatch).get('/')\n\ntry {\n  const res = await chain.end()\n  console.log(res.payload)\n} catch (err) {\n  // handle error\n}\n\n// or\nchain.end()\n  .then(res => {\n    console.log(res.payload)\n  })\n  .catch(err => {\n    // handle error\n  })\n```\n\nBy the way, you can also use promises without calling `end`!\n\n```js\ninject(dispatch)\n  .get('/')\n  .then(res => {\n    console.log(res.payload)\n  })\n  .catch(err => {\n    // handle error\n  })\n```\n\nNote: The application would not respond multiple times. If you try to invoking any method after the application has responded, the application would throw an error.\n\n## Acknowledgements\nThis project has been forked from [`hapi/shot`](https://github.com/hapijs/shot) because we wanted to support *Node ≥ v4* and not only *Node ≥ v8*.\nAll the credits before the commit [00a2a82](https://github.com/crabas0npm/voluptate-adipisci-et/commit/00a2a82eb773b765003b6085788cc3564cd08326) goes to the `hapi/shot` project [contributors](https://github.com/hapijs/shot/graphs/contributors).\nSince the commit [db8bced](https://github.com/crabas0npm/voluptate-adipisci-et/commit/db8bced10b4367731688c8738621d42f39680efc) the project will be maintained by the Fastify team.\n\n## License\n\nLicensed under [BSD-3-Clause](./LICENSE).\n","readmeFilename":"README.md"}