{"id":20987151,"url":"https://github.com/haxpor/bfet","last_synced_at":"2026-04-16T09:02:54.207Z","repository":{"id":143856152,"uuid":"81473476","full_name":"haxpor/bfet","owner":"haxpor","description":"Basic and minimal wrapped around http|https module of nodejs for internet request","archived":false,"fork":false,"pushed_at":"2017-03-01T10:40:52.000Z","size":67,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T20:45:59.120Z","etag":null,"topics":["bfet","browser","http","https","javascript","js","nodejs","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haxpor.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":"2017-02-09T17:00:27.000Z","updated_at":"2017-02-09T17:14:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ce6379f-2582-41dd-9671-5ad92ab3a8e2","html_url":"https://github.com/haxpor/bfet","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/haxpor/bfet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Fbfet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Fbfet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Fbfet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Fbfet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haxpor","download_url":"https://codeload.github.com/haxpor/bfet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Fbfet/sbom","scorecard":{"id":457998,"data":{"date":"2025-08-11","repo":{"name":"github.com/haxpor/bfet","commit":"ba78c5c2c74423c7e4ee072ae77c91caa5da6797"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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-19T10:16:13.366Z","repository_id":143856152,"created_at":"2025-08-19T10:16:13.366Z","updated_at":"2025-08-19T10:16:13.366Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31878833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["bfet","browser","http","https","javascript","js","nodejs","wrapper"],"created_at":"2024-11-19T06:16:09.688Z","updated_at":"2026-04-16T09:02:54.187Z","avatar_url":"https://github.com/haxpor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bfet\nA thin minimal wrapped around http|https NodeJS module for NodeJS and Browser.\n\n# Features\n\nbfet supports sending `GET` and `POST` request method for both HTTP and HTTPS with an option to parse response as JSON or just simple string. Support Promise as return. It has internal caching system for GET request and you can enable or disable it.\n\nOnly target url that supports [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) will work on browser, otherwise it will return error accordingly. There should be no problem on NodeJS.\n\n# Install\n\nInstall it via `npm install bfet`\n\n# Usage\n\n## Promise Ready\n\n```javascript\nbfet.get(\"https://targetdomain.com\")\n\t\t.then((result) =\u003e {\n\t\t\t// actual result data: result.response\n\t\t\t// response's HTTP headers: result.responseHeaders\n\t\t}, (e) =\u003e {\n\t\t\t// error code and message: e.code and e.message\n\t\t\t// response's HTTP headers: e.responseHeaders\n\t\t});\n```\n\n## GET Request\n\n`bfet.get(\"https://targetdomain.com\")`\n\n`bfet.get(\"https://targetdomain.com?myanswer=1\")`\n\n`bfet.get(\"https://targetdomain.com\", { myanswer: 1 })`\n\n`bfet.get(\"https://targetdomain.com\", { myanswer: 1 }, { json_parse: false })`\n\n`bfet.get(\"https://targetdomain.com\", { myanswer: 1 }, { username: \"myusername\", password: \"mypassword\" })`\n\n```javascript\nbfet.get(\"https://targetdomain.com\", \n\t{ myanswer: 1 }, \n\t{ \n\t\tusername: \"myusername\", \n\t\tpassword: \"mypassword\", \n\t\theaders: {\n\t\t\t'If-None-Match': '\"d751713988987e9331980363e24189ce\"'\n\t\t}\n\t})\n```\n\n## POST Request\n\n`bfet.post(\"https://targetdomain.com\", { myanswer: 1 })`\n\n`bfet.post(\"https://targetdomain.com\", { myanswer: 1 }, { json_parse: false })`\n\n`bfet.post(\"https://targetdomain.com\", { myanswer: 1 }, { username: \"myusername\", password: \"mypassword\" })`\n\n## Caching\n\nBy default, it's enabled with internal caching for GET request.  \nIt makes much more sense to cache only GET request as almost for POST request, it's just an acknowledge short response that user has successfully updated or created new resource. GET request is more likely to be dynamically changed, and larger in size.\n\nbfet allows user to manually handle caching without relying on internal system although this would achieve the same result.\n\n### Manual Cache Handling\n\nSee the following code\n\n```javascript\n\n\tbfet.global.options.enableCaching = false;\n\n\tvar etag;\n\tvar cachedItem;\n\n\t// make a first request\n\tbfet.get(url)\n\t\t.then((r1) =\u003e {\n\t\t\t// save cached item\n\t\t\t// normally users handle cached item here\n\t\t\tcachedItem = r1.response;\n\t\t\t// save etag\n\t\t\tetag = r1.responseHeaders.etag;\n\n\t\t\t// 2nd request\n\t\t\tbfet.get(url, null, { \n\t\t\t\theaders: {\n\t\t\t\t\t'If-None-Match': etag\n\t\t\t\t}\n\t\t\t}).then((r2) =\u003e {\n\t\t\t\t\t// if cache hit, this line should not be reached\n\t\t\t\t}, (e2) =\u003e {\n\t\t\t\t\t// e2.code = 304 indicates that resource is not modified\n\t\t\t\t\t// feel free to grab local resource and use it via cachedItem as we saved eariler\n\t\t\t\t});\n\n\t\t}, (e1) =\u003e {\n\t\t\t// handle error for first request\n\t\t});\n```\n\nConcept is as follows\n\n1. User disable caching via `bfet.global.options.enableCaching`\n2. Make a first request\n3. Save etag, or last-modified from response's headers, and also save response data\n4. Make a second request with additional header of either `If-None-Match` or `If-Modified-Since`.\n5. If cache hit, user should receive error result with code `304`.\n6. Otherwise, observe error code for other circumstances.\n\n## Options\n\n### Individual Options\n\nYou have following options to set for your request.\n\n* `json_parse` - `Boolean` - Default is `true`, you can set to `false` to not parse the result you get.\n* `username` - `String` - If target URL needs basic authorization, you can set username here.\n* `password` - `String` - If target URl needs basic authorization, you can set password here.\n* `headers` - `Object` - Headers as object for additional headers to be sent along with the request.\n\n### Global Options\n\nbfet has global options which if configured will affect the whole system\n\n* `bfet.global.options.enableCaching` - enable/disable internal caching, pretty much relates to HTTP 304 status code\n\n# Development\n\n- `npm run build` - to create a bundle files in `./dist` directory\n- `npm test` - to run tests for both NodeJS and browser\n- `npm run http-and-watch` - to build, start local http-server and watch changes on file for live reloading\n\n# Misc\nThis project is based on [basejit](https://github.com/haxpor/basejit)\n\n# License\n\n[![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/)  \nThis work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://github.com/haxpor/bfet/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxpor%2Fbfet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaxpor%2Fbfet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxpor%2Fbfet/lists"}