{"id":26406431,"url":"https://github.com/binary-blazer/blink-http","last_synced_at":"2025-03-17T17:19:46.372Z","repository":{"id":281486569,"uuid":"945422889","full_name":"binary-blazer/blink-http","owner":"binary-blazer","description":"A tiny and standalone HTTP client based on XMLHttpRequest","archived":false,"fork":false,"pushed_at":"2025-03-09T12:56:11.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T12:56:35.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/blink-http","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binary-blazer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-09T11:43:46.000Z","updated_at":"2025-03-09T12:56:14.000Z","dependencies_parsed_at":"2025-03-09T12:56:37.271Z","dependency_job_id":"ddd9e62e-1d87-4596-82dd-1752fcc2b37c","html_url":"https://github.com/binary-blazer/blink-http","commit_stats":null,"previous_names":["binary-blazer/blink-http"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binary-blazer%2Fblink-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binary-blazer%2Fblink-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binary-blazer%2Fblink-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binary-blazer%2Fblink-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binary-blazer","download_url":"https://codeload.github.com/binary-blazer/blink-http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075626,"owners_count":20393980,"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":[],"created_at":"2025-03-17T17:19:45.819Z","updated_at":"2025-03-17T17:19:46.361Z","avatar_url":"https://github.com/binary-blazer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blink HTTP\r\n\r\nA fast, elegant and standalone HTTP client.\r\n\r\n[![npm](https://img.shields.io/npm/v/blink-http)](https://www.npmjs.com/package/blink-http)\r\n[![npm](https://img.shields.io/npm/dt/blink-http)](https://www.npmjs.com/package/blink-http)\r\n[![CI](https://github.com/binary-blazer/blink-http/actions/workflows/ci.yml/badge.svg)](https://github.com/binary-blazer/blink-http/actions/workflows/ci.yml)\r\n\r\n## Installation\r\n\r\nYou can install the package using npm, pnpm, yarn or bun.\r\n\r\n```sh\r\nnpm install blink-http\r\n# or\r\npnpm add blink-http\r\n# or\r\nyarn add blink-http\r\n# or\r\nbun install blink-http\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n#### with BaseURL:\r\n```javascript\r\nimport { BlinkClient } from 'blink-http';\r\n\r\nconst blink = new BlinkClient({\r\n    baseURL: 'https://jsonplaceholder.typicode.com', // is optional\r\n    timeout: 10000, // is optional\r\n    userAgent: 'custom-user-agent' // is optional\r\n});\r\n\r\nconst response = await blink.get('/posts/1');\r\nconsole.log(await response.json()); // return response as JSON\r\n```\r\n\r\n#### without BaseURL:\r\n```javascript\r\nimport { BlinkClient } from 'blink-http';\r\n\r\nconst blink = new BlinkClient({\r\n    timeout: 10000, // is optional\r\n    userAgent: 'custom-user-agent' // is optional\r\n});\r\n\r\nconst response = await blink.get('https://jsonplaceholder.typicode.com/posts/1');\r\nconsole.log(await response.json()); // return response as JSON\r\n```\r\n\r\n## Methods\r\n\r\n- **`get`**\r\n  ```typescript\r\n  get(url: string, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`post`**\r\n  ```typescript\r\n  post(url: string, body: any, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`put`**\r\n  ```typescript\r\n  put(url: string, body: any, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`delete`**\r\n  ```typescript\r\n  delete(url: string, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`patch`**\r\n  ```typescript\r\n  patch(url: string, body: any, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`head`**\r\n  ```typescript\r\n  head(url: string, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`options`**\r\n  ```typescript\r\n  options(url: string, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n- **`trace`**\r\n  ```typescript\r\n  trace(url: string, options?: Omit\u003cRequestInit, \"body\" | \"method\"\u003e, queryParams?: Record\u003cstring, string\u003e, onProgress?: (event: ProgressEvent) =\u003e void): Promise\u003cResponse\u003e\r\n  ```\r\n\r\n## Examples\r\n\r\n### GET Request\r\n\r\n```javascript\r\nconst response = await blink.get('https://jsonplaceholder.typicode.com/posts/1');\r\nconsole.log(response.json());\r\n```\r\n\r\n### POST Request\r\n\r\n```javascript\r\nconst response = await blink.post('https://jsonplaceholder.typicode.com/posts', { title: 'foo', body: 'bar', userId: 1 });\r\nconsole.log(response.json());\r\n```\r\n\r\n## Contributing\r\n\r\nPlease read the [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.\r\n\r\n## License\r\n\r\nThis project is licensed under the BSD-3-Clause License - see the [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinary-blazer%2Fblink-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinary-blazer%2Fblink-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinary-blazer%2Fblink-http/lists"}