{"id":15753559,"url":"https://github.com/marella/shr","last_synced_at":"2025-08-25T01:38:56.718Z","repository":{"id":57358961,"uuid":"110811540","full_name":"marella/shr","owner":"marella","description":"Simple HTTP requests for browser. \"Simple requests\" don't trigger a CORS preflight.","archived":false,"fork":false,"pushed_at":"2021-06-08T17:47:52.000Z","size":182,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T16:01:53.413Z","etag":null,"topics":["ajax","browser","cors","http-client","xhr"],"latest_commit_sha":null,"homepage":null,"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/marella.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":"2017-11-15T09:18:59.000Z","updated_at":"2024-02-14T02:09:27.000Z","dependencies_parsed_at":"2022-09-06T21:41:15.565Z","dependency_job_id":null,"html_url":"https://github.com/marella/shr","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/marella/shr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fshr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fshr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fshr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fshr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marella","download_url":"https://codeload.github.com/marella/shr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fshr/sbom","scorecard":{"id":618808,"data":{"date":"2025-08-11","repo":{"name":"github.com/marella/shr","commit":"698a9c5a5010c631e1bc45419e2b4db92e6ca062"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/16 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":"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":"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":"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":"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":"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-21T04:42:50.970Z","repository_id":57358961,"created_at":"2025-08-21T04:42:50.970Z","updated_at":"2025-08-21T04:42:50.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271992943,"owners_count":24855099,"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-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["ajax","browser","cors","http-client","xhr"],"created_at":"2024-10-04T07:41:10.232Z","updated_at":"2025-08-25T01:38:56.671Z","avatar_url":"https://github.com/marella.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shr\n\nSimple HTTP requests for browser. \"[Simple requests]\" don't trigger a [CORS preflight].\n\n[![Build Status](https://travis-ci.org/marella/shr.svg?branch=master)](https://travis-ci.org/marella/shr) [![Coverage Status](https://coveralls.io/repos/github/marella/shr/badge.svg)](https://coveralls.io/github/marella/shr)\n\n\n## Installation\n\n```bash\nnpm install shr --save\n```\n\n\n## Example\n\n```js\nimport client from 'shr'\n\nclient\n  .get('https://api.example.com/users')\n  .then(response =\u003e {\n    console.log(response)\n  })\n  .catch(error =\u003e {\n    console.log(error)\n  })\n```\n\n\n## Documentation\n\nTo avoid [preflight requests][CORS preflight], `data` is serialized using [qs] library and sent with `Content-Type` header as `application/x-www-form-urlencoded`. `PUT`, `PATCH` and `DELETE` requests are made as `POST` requests with an additional field `_method` set to the method name which needs to be supported by the backend.\n\n### Available Methods\n\n```js\nimport { create } from 'shr'\n\nconst client = create(options)\n\nclient.request(url, options)\nclient.get(url, params, options)\nclient.post(url, data, options)\nclient.put(url, data, options)\nclient.patch(url, data, options)\nclient.delete(url, data, options)\n```\n\n### Options\n\n```js\n{\n  baseURL: '',\n\n  method: 'get',\n\n  params: {},\n\n  data: {},\n\n  headers: {\n    Accept: 'application/json, text/plain, */*',\n    'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',\n  },\n\n  transformRequest(data) {\n    return data\n  },\n\n  transformResponse(data) {\n    return data\n  },\n\n  isValid: ({ status }) =\u003e status \u003e= 200 \u0026\u0026 status \u003c 300,\n\n  timeout: 0,\n\n  withCredentials: false,\n\n  responseType: 'json',\n\n  onDownloadProgress: () =\u003e {},\n\n  onUploadProgress: () =\u003e {},\n}\n```\n\n### Response\n\n```js\n{\n  data: {},\n  status: 200,\n  statusText: 'OK',\n}\n```\n\n### Error\n\n```js\n{\n  message: '',\n  response: {},\n}\n```\n\n\n## License\n\n[MIT][license]\n\n\n[license]: /LICENSE\n[Simple requests]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n[CORS preflight]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests\n[qs]: https://github.com/ljharb/qs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fshr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarella%2Fshr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fshr/lists"}