{"id":18624154,"url":"https://github.com/km-saifullah/quick-response","last_synced_at":"2026-02-24T21:31:07.016Z","repository":{"id":252798152,"uuid":"841538296","full_name":"km-saifullah/quick-response","owner":"km-saifullah","description":"This is a npm package for sending api response in a particular format.","archived":false,"fork":false,"pushed_at":"2024-08-30T16:41:19.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T03:11:11.482Z","etag":null,"topics":["api","api-response","jaavscript","nodejs","npm","npm-package","quick-response"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/quick-response","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/km-saifullah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-12T15:52:00.000Z","updated_at":"2025-08-01T10:52:34.000Z","dependencies_parsed_at":"2024-11-07T04:29:39.160Z","dependency_job_id":null,"html_url":"https://github.com/km-saifullah/quick-response","commit_stats":null,"previous_names":["km-saifullah/quick-response"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/km-saifullah/quick-response","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/km-saifullah%2Fquick-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/km-saifullah%2Fquick-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/km-saifullah%2Fquick-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/km-saifullah%2Fquick-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/km-saifullah","download_url":"https://codeload.github.com/km-saifullah/quick-response/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/km-saifullah%2Fquick-response/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29801021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T21:02:39.706Z","status":"ssl_error","status_checked_at":"2026-02-24T21:02:21.834Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-response","jaavscript","nodejs","npm","npm-package","quick-response"],"created_at":"2024-11-07T04:27:38.444Z","updated_at":"2026-02-24T21:31:06.985Z","avatar_url":"https://github.com/km-saifullah.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quick-response\n\nAPI response message for any Node JS application\n\n![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge\u0026logo=nodedotjs\u0026logoColor=white)\n![API](https://img.shields.io/badge/API-FF6F61?style=for-the-badge\u0026logo=api\u0026logoColor=white)\n![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge\u0026logo=javascript\u0026logoColor=black)\n\n## Installation\n\nInstall the package in your project\n\n```bash\nnpm quick-response\n```\n\n## Usage\n\nThe package provides a utility function called `apiResponse` that allows you to create API response objects\n\nThe `apiResponse` function accepts the following parameters:\n\n\u003cb\u003estatusCode (number)\u003c/b\u003e:\n\n- The HTTP status code to be returned with the response.\n- Example values: 200 (OK), 404 (Not Found), 500 (Internal Server Error).\n\n\u003cb\u003emessage (string)\u003c/b\u003e:\n\n- A brief message describing the response.\n- Example values: 'Success', 'Resource not found', 'Internal server error'.\n\n\u003cb\u003edata (object, optional)\u003c/b\u003e:\n\n- An optional object containing additional data to be included in the response.\n- If not provided, the data field in the response will be set to null.\n- Example value: { id: 1, name: 'John Doe' }.\n\n1. If you are using common js\n\n```javascript\nconst apiResponse = require(\"quick-response\");\nconsole.log(apiResponse(200, \"Success\", { id: 1 }));\n```\n\n2. If you are using module js\n\n```javascript\nimport apiResponse from \"quick-response\";\nconsole.log(apiResponse(200, \"Success\", { id: 1 }));\n```\n\n**Response**\n\n```javascript\n{\n  statusCode: 200,\n  message: 'Success',\n  data: { id: 1 },\n  timestamp: 'Fri Aug 30 2024'\n}\n```\n\n## Usage with Express\n\n```javascript\nimport express from \"express\";\nimport apiResponse from \"quick-response\";\n\nconst app = express();\nconst port = 8000;\n\napp.get(\"/\", (req, res) =\u003e {\n  res.json(apiResponse(201, \"User Created\", { id: 1, name: \"John Doe\" }));\n});\n\napp.listen(port, () =\u003e console.log(\"Server is running\"));\n```\n\n**Result**\n\n```javascript\n{\n  \"statusCode\": 201,\n  \"message\": \"User Created\",\n  \"data\": {\n    \"id\": 1,\n    \"name\": \"John Doe\"\n  },\n  \"timestamp\": \"Fri Aug 30 2024\"\n}\n```\n\nHappy Coding...👍\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkm-saifullah%2Fquick-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkm-saifullah%2Fquick-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkm-saifullah%2Fquick-response/lists"}