{"id":16520564,"url":"https://github.com/jfbrennan/retchful","last_synced_at":"2026-05-13T09:02:48.949Z","repository":{"id":57355199,"uuid":"157243738","full_name":"jfbrennan/retchful","owner":"jfbrennan","description":"Makes RESTful calls more reliable \u0026 enjoyable than using fetch directly","archived":false,"fork":false,"pushed_at":"2020-02-07T01:03:23.000Z","size":98,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T02:20:52.749Z","etag":null,"topics":["fetch","javascript","json","rest"],"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/jfbrennan.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}},"created_at":"2018-11-12T16:34:33.000Z","updated_at":"2020-10-25T12:39:55.000Z","dependencies_parsed_at":"2022-09-09T09:50:58.502Z","dependency_job_id":null,"html_url":"https://github.com/jfbrennan/retchful","commit_stats":null,"previous_names":["jfbrennan/retch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jfbrennan/retchful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfbrennan%2Fretchful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfbrennan%2Fretchful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfbrennan%2Fretchful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfbrennan%2Fretchful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfbrennan","download_url":"https://codeload.github.com/jfbrennan/retchful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfbrennan%2Fretchful/sbom","scorecard":{"id":517313,"data":{"date":"2025-08-11","repo":{"name":"github.com/jfbrennan/retchful","commit":"4d912a51b59ba9e1a3db070cb2de8075efb2bf61"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T02:10:14.632Z","repository_id":57355199,"created_at":"2025-08-20T02:10:14.632Z","updated_at":"2025-08-20T02:10:14.632Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32975183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: 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":["fetch","javascript","json","rest"],"created_at":"2024-10-11T16:51:36.070Z","updated_at":"2026-05-13T09:02:48.928Z","avatar_url":"https://github.com/jfbrennan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RETCHful\nRETCHful is three simple functions that make doing RESTful calls more reliable and enjoyable than using `fetch` directly. It works on both client and server. \n\n## API\n\n`retch.get(url[, options])` Sends an HTTP `GET` for all resources. Get a specific resource by setting the `id` option. Optionally attach query params by setting `query` in options.\n\n`retch.save(url[, options])` Sends an HTTP `POST` if there is no id. If there is an id, then it'll `PUT`. If id has a different name configure it using the `altId` option.\n\n`retch.delete(url, {id})` Sends an HTTP `DELETE`. You must include the id option.\n\n`url` A string. Do not include the id of the resource; it will be taken from `options`. Ending with or without \"/\" is okay.\n\n`options` Pass-through to fetch's [init](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) arg with a few things to be aware of: \n\n- `body` is stringified for you.\n- `method` is set based on the function used (see above).\n- `query` (RETCHful only) Key-value object added non-destructively to `url` as a query string. Primarily for `get`, but works with all.\n- `id` (RETCHful only) A number or string. If present, will be appended to `url`. Required by `delete` and used by `get` to fetch a single resource rather than all. `save` ignores this and instead looks at `body` for the id of the resource (see `altId` for more info). \n- `altId` (RETCHful only) Specify an alternative name for the id property of `body`. Save uses this name or defaults to `body.id`.\n\n**Notes**\n\nThe get, save, and delete functions ultimately call fetch and return the Promise from `response.json()`. Internally `response.ok` is checked for you and if not ok the Promise is rejected. Also, the default values used for [init](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) can be seen here: [https://github.com/jfbrennan/retch/blob/master/index.js#L34](https://github.com/jfbrennan/retch/blob/master/index.js#L34)\n\n\n**Examples**\n```javascript\n// Require it server-side or use the `retch` global in the browser\nconst retch = require('retchful');\n\n// Todos endpoint\nconst url = 'https://jsonplaceholder.typicode.com/todos';\n\n// Fetch all todos\n// GET https://jsonplaceholder.typicode.com/todos\nretch.get(url)\n    .then(data =\u003e console.log(data)) \n\n// Fetch todos with query params\n// GET https://jsonplaceholder.typicode.com/todos?completed=false\nretch.get(url, {query: {completed: false}})\n    .then(data =\u003e console.log(data)) \n\n// Fetch a specific todo\n// GET https://jsonplaceholder.typicode.com/todos/1\nretch.get(url, {id: '1'})\n    .then(data =\u003e console.log(data)) \n\n// Save a new todo\n// POST https://jsonplaceholder.typicode.com/todos\nretch.save(url, {body: {title: 'Foo', body: 'Bar'}})\n    .then(data =\u003e console.log(data)) \n\n// Save changes to an existing todo\n// PUT https://jsonplaceholder.typicode.com/todos/1\nretch.save(url, {body: {id: '1', title: 'Foo', body: 'Baz'}})\n    .then(data =\u003e console.log(data)) \n\n// Save changes to todo when id is not named \"id\"\n// PUT https://jsonplaceholder.typicode.com/todos/1\nretch.save(url, {altId: 'todo_id', body: {todo_id: '1', title: 'Foo', body: 'Baz'}})\n    .then(data =\u003e console.log(data)) \n\n// Delete a todo\n// DELETE https://jsonplaceholder.typicode.com/todos/1\nretch.delete(url, {id: '1'})\n    .then(data =\u003e console.log(data)) \n\n```\n\n## Installation\n**CDN**\n\n`https://unpkg.com/retchful@1.0.0-beta/dist/min.js`\n\nThen just use the global `retch.get|save|delete` functions. Too easy. \n\nNote that RETCHful makes use of [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL), and [URLSearchParams.append](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/append), so you may need to polyfill for older browsers. The excellent [polyfill.io](https://polyfill.io/v3/) service is a really smart way to go. \n\n**NPM** \n\n`npm install retchful`\n\n`const retch = require('retchful')`\n\nNote that retch makes use of fetch, which needs to be installed for Node. The [node-fetch](https://www.npmjs.com/package/node-fetch) module is recommended.\n\n## Credits\nFetch is a low level API, so it gets ugly when used directly. I took some inspiration from [Backbone](http://backbonejs.org) which imo is one of the most developer-friendly libraries ever. It's still the best when working with lots of a RESTful APIs, so retch attempts to give you some of that goodness. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfbrennan%2Fretchful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfbrennan%2Fretchful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfbrennan%2Fretchful/lists"}