{"id":17215133,"url":"https://github.com/codyjdalton/default-response","last_synced_at":"2025-07-23T14:06:11.326Z","repository":{"id":95310925,"uuid":"60366062","full_name":"codyjdalton/default-response","owner":"codyjdalton","description":"Default response body module for use in web services","archived":false,"fork":false,"pushed_at":"2018-06-14T00:58:46.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T22:05:37.142Z","etag":null,"topics":["http","http-response","http-server","response-code","rest","status","status-code"],"latest_commit_sha":null,"homepage":"","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/codyjdalton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-06-03T17:35:35.000Z","updated_at":"2018-06-14T01:00:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"55e50028-94b4-48ec-99d5-553310d2debd","html_url":"https://github.com/codyjdalton/default-response","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"0b5b8413407b2bf80bc9818d481e60e820d2261b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/codyjdalton/default-response","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codyjdalton%2Fdefault-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codyjdalton%2Fdefault-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codyjdalton%2Fdefault-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codyjdalton%2Fdefault-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codyjdalton","download_url":"https://codeload.github.com/codyjdalton/default-response/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codyjdalton%2Fdefault-response/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266691580,"owners_count":23969182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["http","http-response","http-server","response-code","rest","status","status-code"],"created_at":"2024-10-15T03:23:23.237Z","updated_at":"2025-07-23T14:06:11.296Z","avatar_url":"https://github.com/codyjdalton.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/codyjdalton/default-response.svg?branch=master)](https://travis-ci.org/codyjdalton/default-response) [![Coverage Status](https://coveralls.io/repos/github/codyjdalton/default-response/badge.svg?branch=master)](https://coveralls.io/github/codyjdalton/default-response?branch=master) [![npm version](https://badge.fury.io/js/default-response.svg)](https://badge.fury.io/js/default-response)\n\n# Default Response\n\nSimple API \"default message\" module for use with RESTful APIs.\n\n## Installation\n```{r, engine='shell'}\n$ npm i default-response\n```\n\n## Basic Usage\n\nInclude the dependency and call response.status(code):\n\n```javascript\n// include default response\nconst response = require('default-response');\n\n// set a status\nconsole.log(response.status(404));\n```\nLogs:\n```json\n{\n  \"status\": 404,\n  \"message\": \"Not found\",\n  \"developerMessage\": \"The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.\",\n  \"error\": \"ClientError\"\n}\n```\nAnd many, many more...\n\n## Custom Developer Messages\n```javascript\n// include default response\nconst response = require('default-response');\n\n// set a status\nconsole.log(\n  response.statusMessage(\n    401, \n    \"You do not have permission to access the users resource.\"\n  )\n);\n```\nLogs:\n```json\n{\n  \"status\": 401,\n  \"message\": \"Unauthorized\",\n  \"developerMessage\": \"You do not have permission to access the users resource.\",\n  \"error\": \"ClientError\"\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodyjdalton%2Fdefault-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodyjdalton%2Fdefault-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodyjdalton%2Fdefault-response/lists"}