{"id":13621048,"url":"https://github.com/hansputera/tiny-http","last_synced_at":"2025-10-08T11:32:38.140Z","repository":{"id":40317416,"uuid":"413730234","full_name":"hansputera/tiny-http","owner":"hansputera","description":"My Tiny HTTP Client with zero dependency.","archived":true,"fork":false,"pushed_at":"2022-05-15T13:32:02.000Z","size":301,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-02T08:04:34.562Z","etag":null,"topics":["education","http","https","javascript","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://hansputera.github.io/tiny-http/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansputera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-05T08:15:23.000Z","updated_at":"2024-03-04T05:38:01.000Z","dependencies_parsed_at":"2022-07-25T01:32:38.360Z","dependency_job_id":null,"html_url":"https://github.com/hansputera/tiny-http","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/hansputera%2Ftiny-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansputera%2Ftiny-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansputera%2Ftiny-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansputera%2Ftiny-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansputera","download_url":"https://codeload.github.com/hansputera/tiny-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235708944,"owners_count":19033118,"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":["education","http","https","javascript","nodejs","typescript"],"created_at":"2024-08-01T21:01:02.049Z","updated_at":"2025-10-08T11:32:32.822Z","avatar_url":"https://github.com/hansputera.png","language":"TypeScript","readme":"# My Tiny HTTP Client\n\nSimple HTTP Client built with zero dependency.\n\n### Installation\n\u003e npm install hanif-tiny-http --only=prod\n\n\u003e yarn add hanif-tiny-http --production\n\n### Basic usage\n\nES\n\n```typescript\nimport { TinyHttpClient } from \"hanif-tiny-http\";\n\nconst client = new TinyHttpClient({\n    baseURL: \"https://hastebin.com\"\n});\n\ninterface HastebinOut {\n    key: string;\n}\n\nclient.post(\"documents\", \"hello-world\").then((response) =\u003e {\n    response.getJSON\u003cHastebinOut\u003e().then((json) =\u003e {\n        console.log(json.key);\n    });\n});\n```\n\nCJS\n\n```javascript\nconst { TinyHttpClient } = require(\"hanif-tiny-http\");\n\nconst client = new TinyHttpClient({\n    baseURL: \"https://hastebin.com\"\n});\n\nclient.post(\"documents\", \"hello-world\").then((response) =\u003e {\n    response.getJSON().then((json) =\u003e {\n        console.log(json.key);\n    });\n});\n```\n\n### Stream Usage\n\nDo you want to download a video or something with streaming mode?\nWell, that's probably here.\n\nSimply enter 'stream' in the request option, fill it with a boolean value.\n\n**Example:**\n\n```ts\nclient.get('https://somesite.com', { stream: true }).then((response) =\u003e {\n    response.stream; // use it.\n});\n```\n\nAlso, if you want get download progress that's possible here.\n\u003e `onDownload` won't work without stream mode.\n\n```ts\nclient.get('https://somesite.com', { stream: true }).then((response) =\u003e {\n    response.onDownload((totalBytes, downloadedBytes) =\u003e {\n        // stuff..\n    });\n});\n```\n\n**What's difference?**\n\nIf the stream option is enabled, you'll receive a response class instantly without having the response content load perfectly.\n\nIf the stream option is disabled, you'll need to wait until the response content loads correctly.\n\n### Contribution\nYou are welcome to contribute this package.\n~~if you want~~\n\n### Note\nThis package is intended for personal use.\n","funding_links":[],"categories":["T"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansputera%2Ftiny-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansputera%2Ftiny-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansputera%2Ftiny-http/lists"}