{"id":13447616,"url":"https://github.com/mikeal/r2","last_synced_at":"2025-05-14T01:04:11.121Z","repository":{"id":60775134,"uuid":"101939229","full_name":"mikeal/r2","owner":"mikeal","description":"HTTP client. Spiritual successor to request.","archived":false,"fork":false,"pushed_at":"2019-09-01T16:23:58.000Z","size":73,"stargazers_count":4433,"open_issues_count":30,"forks_count":115,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-05-04T19:39:14.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mikeal.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":"2017-08-30T23:50:18.000Z","updated_at":"2025-04-26T15:37:40.000Z","dependencies_parsed_at":"2022-10-04T16:34:43.961Z","dependency_job_id":null,"html_url":"https://github.com/mikeal/r2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fr2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fr2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fr2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fr2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeal","download_url":"https://codeload.github.com/mikeal/r2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253540761,"owners_count":21924535,"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":"2024-07-31T05:01:22.465Z","updated_at":"2025-05-14T01:04:11.087Z","avatar_url":"https://github.com/mikeal.png","language":"JavaScript","readme":"# r2\n\n[![Build Status](https://travis-ci.org/mikeal/r2.svg?branch=master)](https://travis-ci.org/mikeal/r2) [![Coverage Status](https://coveralls.io/repos/github/mikeal/r2/badge.svg?branch=master)](https://coveralls.io/github/mikeal/r2?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/mikeal/r2.svg)](https://greenkeeper.io/)\n\nEarly in Node.js I wrote an HTTP client library called `request`. It evolved\nalong with Node.js and eventually became very widely depended upon.\n\nA lot has changed since 2010 and I've decided to re-think what a simple\nHTTP client library should look like.\n\nThis new library, `r2`, is a completely new approach from `request`.\n\n* Rather than being built on top of the Node.js Core HTTP library and\n  shimmed for the browser, `r2` is built on top of the browser's\n  Fetch API and shimmed for Node.js.\n* APIs are meant to be used with async/await, which means they are\n  based on promises.\n\n```javascript\nconst r2 = require('r2')\n\nlet html = await r2('https://www.google.com').text\n```\n\nSimple JSON support.\n\n```javascript\nlet obj = {ok: true}\n\nlet resp = await r2.put('http://localhost/test.json', {json: obj}).json\n```\n\nSimple headers support.\n\n```javascript\nlet headers = {'x-test': 'ok'}\n\nlet res = await r2('http://localhost/test', {headers}).response\n```\n\nBeing written to the Fetch API is a huge benefit for browser users.\n\nWhen running through browserify `request` is ~2M uncompressed and ~500K compressed. `r2` is only 66K uncompressed and 16K compressed.\n","funding_links":[],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeal%2Fr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeal%2Fr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeal%2Fr2/lists"}