{"id":32226783,"url":"https://github.com/iriscouch/browser-request","last_synced_at":"2025-10-22T09:56:56.245Z","repository":{"id":2084600,"uuid":"3024190","full_name":"iriscouch/browser-request","owner":"iriscouch","description":"Browser library compatible with Node.js request package","archived":false,"fork":false,"pushed_at":"2024-07-09T04:13:11.000Z","size":7327,"stargazers_count":367,"open_issues_count":61,"forks_count":103,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-22T09:56:46.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iriscouch.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":"2011-12-21T02:40:44.000Z","updated_at":"2025-07-13T08:07:02.000Z","dependencies_parsed_at":"2022-08-06T12:00:35.669Z","dependency_job_id":null,"html_url":"https://github.com/iriscouch/browser-request","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/iriscouch/browser-request","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iriscouch%2Fbrowser-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iriscouch%2Fbrowser-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iriscouch%2Fbrowser-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iriscouch%2Fbrowser-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iriscouch","download_url":"https://codeload.github.com/iriscouch/browser-request/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iriscouch%2Fbrowser-request/sbom","scorecard":{"id":494382,"data":{"date":"2025-08-11","repo":{"name":"github.com/iriscouch/browser-request","commit":"d99a386fc9f8109555cd92b7f3287cc5d816aa24"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"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":"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":"Code-Review","score":2,"reason":"Found 4/17 approved changesets -- score normalized to 2","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":"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":"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: Apache License 2.0: 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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T20:05:05.863Z","repository_id":2084600,"created_at":"2025-08-19T20:05:05.863Z","updated_at":"2025-08-19T20:05:05.863Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280416598,"owners_count":26327044,"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-10-22T02:00:06.515Z","response_time":63,"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":[],"created_at":"2025-10-22T09:56:50.749Z","updated_at":"2025-10-22T09:56:56.240Z","avatar_url":"https://github.com/iriscouch.png","language":"JavaScript","readme":"# Browser Request: The easiest HTTP library you'll ever see\n\nBrowser Request is a port of Mikeal Rogers's ubiquitous and excellent [request][req] package to the browser.\n\nJealous of Node.js? Pining for clever callbacks? Request is for you.\n\nDon't care about Node.js? Looking for less tedium and a no-nonsense API? Request is for you too.\n\n[![browser support](https://ci.testling.com/iriscouch/browser-request.png)](https://ci.testling.com/maxogden/browser-request)\n\n# Examples\n\nFetch a resource:\n\n```javascript\nrequest('/some/resource.txt', function(er, response, body) {\n  if(er)\n    throw er;\n  console.log(\"I got: \" + body);\n})\n```\n\nSend a resource:\n\n```javascript\nrequest.put({uri:'/some/resource.xml', body:'\u003cfoo\u003e\u003cbar/\u003e\u003c/foo\u003e'}, function(er, response) {\n  if(er)\n    throw new Error(\"XML PUT failed (\" + er + \"): HTTP status was \" + response.status);\n  console.log(\"Stored the XML\");\n})\n```\n\nTo work with JSON, set `options.json` to `true`. Request will set the `Content-Type` and `Accept` headers, and handle parsing and serialization.\n\n```javascript\nrequest({method:'POST', url:'/db', body:'{\"relaxed\":true}', json:true}, on_response)\n\nfunction on_response(er, response, body) {\n  if(er)\n    throw er\n  if(result.ok)\n    console.log('Server ok, id = ' + result.id)\n}\n```\n\nOr, use this shorthand version (pass data into the `json` option directly):\n\n```javascript\nrequest({method:'POST', url:'/db', json:{relaxed:true}}, on_response)\n```\n\n## Convenient CouchDB\n\nBrowser Request provides a CouchDB wrapper. It is the same as the JSON wrapper, however it will indicate an error if the HTTP query was fine, but there was a problem at the database level. The most common example is `409 Conflict`.\n\n```javascript\nrequest.couch({method:'PUT', url:'/db/existing_doc', body:{\"will_conflict\":\"you bet!\"}}, function(er, resp, result) {\n  if(er.error === 'conflict')\n    return console.error(\"Couch said no: \" + er.reason); // Output: Couch said no: Document update conflict.\n\n  if(er)\n    throw er;\n\n  console.log(\"Existing doc stored. This must have been the first run.\");\n})\n```\n\nSee the [Node.js Request README][req] for several more examples. Request intends to maintain feature parity with Node request (except what the browser disallows). If you find a discrepancy, please submit a bug report. Thanks!\n\n# Usage\n\n## Browserify\n\nBrowser Request is a [browserify][browserify]-enabled package.\n\nFirst, add `browser-request` to your Node project\n\n    $ npm install browser-request\n\nNext, make a module that uses the package.\n\n```javascript\n// example.js - Example front-end (client-side) code using browser-request via browserify\n//\nvar request = require('browser-request')\nrequest('/', function(er, res) {\n  if(!er)\n    return console.log('browser-request got your root path:\\n' + res.body)\n\n  console.log('There was an error, but at least browser-request loaded and ran!')\n  throw er\n})\n```\n\nTo build this for the browser, run it through browserify.\n\n    $ browserify --entry example.js --outfile example-built.js\n\nDeploy `example-built.js` to your web site and use it from your page.\n\n```html\n  \u003cscript src=\"example-built.js\"\u003e\u003c/script\u003e \u003c!-- Runs the request, outputs the result to the console --\u003e\n```\n## License\n\nBrowser Request is licensed under the Apache 2.0 license.\n\n","funding_links":[],"categories":["24. Ajax模块","24. 前后端交互"],"sub_categories":["13.20 视差滚动(Parallax Scrolling) ###","24.1 Ajax模块"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firiscouch%2Fbrowser-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firiscouch%2Fbrowser-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firiscouch%2Fbrowser-request/lists"}