{"id":18295103,"url":"https://github.com/codesuki/superagent-intercept","last_synced_at":"2025-04-05T12:31:22.372Z","repository":{"id":57374641,"uuid":"31642325","full_name":"codesuki/superagent-intercept","owner":"codesuki","description":"Add functions that will be called during end() e.g. for handling error conditions without having the same code all over the place.","archived":false,"fork":false,"pushed_at":"2016-08-15T05:00:21.000Z","size":3,"stargazers_count":23,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T03:51:14.629Z","etag":null,"topics":["error-handling","intercept","interceptor","javascript","proxy","superagent"],"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/codesuki.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":"2015-03-04T06:41:23.000Z","updated_at":"2024-02-23T19:57:08.000Z","dependencies_parsed_at":"2022-08-27T10:27:42.022Z","dependency_job_id":null,"html_url":"https://github.com/codesuki/superagent-intercept","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesuki%2Fsuperagent-intercept","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesuki%2Fsuperagent-intercept/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesuki%2Fsuperagent-intercept/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesuki%2Fsuperagent-intercept/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesuki","download_url":"https://codeload.github.com/codesuki/superagent-intercept/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338750,"owners_count":20922994,"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","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":["error-handling","intercept","interceptor","javascript","proxy","superagent"],"created_at":"2024-11-05T14:33:26.151Z","updated_at":"2025-04-05T12:31:17.355Z","avatar_url":"https://github.com/codesuki.png","language":"JavaScript","readme":"# superagent-intercept\nAdd interceptors that will be called during end() e.g. for handling error conditions without having the same code all over the place.\n\n## Support\nPlease consider supporting the project by starring it on GitHub :)\n\nhttps://github.com/codesuki/superagent-intercept\n\n## Install\n```\nnpm install superagent-intercept\n```\n\n## Example\n```javascript\nlet AuthIntercept = require('superagent-intercept')((err, res) =\u003e {\n\tif (res.status == 401) {\n\t   // route to login\n\t}\n});\n\nrequest.get('/api/something/' + someId).use(AuthIntercept).end((err, res) {\n\t// AuthIntercept will be called here.\n\t// ... code ...\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesuki%2Fsuperagent-intercept","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesuki%2Fsuperagent-intercept","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesuki%2Fsuperagent-intercept/lists"}