{"id":22106978,"url":"https://github.com/legitcode/legible","last_synced_at":"2025-09-03T05:35:54.497Z","repository":{"id":66177149,"uuid":"75681917","full_name":"Legitcode/legible","owner":"Legitcode","description":"the cleanest way to make http requests in js / node","archived":false,"fork":false,"pushed_at":"2017-05-25T20:31:06.000Z","size":34,"stargazers_count":47,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-01T06:38:47.108Z","etag":null,"topics":["fetch","fetch-api","js","node","request"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Legitcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"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":"2016-12-06T01:24:18.000Z","updated_at":"2024-02-08T19:52:03.000Z","dependencies_parsed_at":"2023-02-20T17:46:02.667Z","dependency_job_id":null,"html_url":"https://github.com/Legitcode/legible","commit_stats":{"total_commits":42,"total_committers":4,"mean_commits":10.5,"dds":"0.30952380952380953","last_synced_commit":"bc4483c7a321ff0b08a2ace28eb5211e2fbb01be"},"previous_names":["zackify/legible"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Legitcode/legible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Flegible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Flegible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Flegible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Flegible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Legitcode","download_url":"https://codeload.github.com/Legitcode/legible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Flegible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273397650,"owners_count":25098233,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fetch","fetch-api","js","node","request"],"created_at":"2024-12-01T08:13:23.943Z","updated_at":"2025-09-03T05:35:54.442Z","avatar_url":"https://github.com/Legitcode.png","language":"JavaScript","readme":"[![CircleCI](https://circleci.com/gh/Legitcode/legible.svg?style=svg)](https://circleci.com/gh/Legitcode/legible)  \n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)  \n## Legible  \n\n[See my blog post on why I made this](https://zach.codes/human-readable-ajax-requests/)\n\nProof of concept at making http requests easier to work with in JS / Node. This wraps the fetch api.\n\n```\nnpm install legible --save\n```\n\nA request library using template literals. Making requests has never been so straight forward! Make it easy for users to adopt your api, document it using this library, and everyone will understand making requests.\n\n### Example\n\n```js\nimport request from 'legible'\n\nasync function TestRequest() {\n  let body = {\n    email: 'test@test.com',\n    password: 'secret'\n  }\n\n  let response = await request`\n    url: https://api.myapp.com/register\n    method: POST\n    body: ${body}\n    headers: ${{\n      Authorization: 'Bearer: token'\n    }}\n  `\n}\n```\n\n## Partial Requests\n\n**New in 0.2.0!**\n\n\nUsing template strings, we can pull out variables easily and keep requests as `legible` as possible. Imagine splitting out your code like this using api libraries that include requests like so:\n\n```js\nimport { partial } from 'legible'\n\nconst twitter = {\n  register: partial`\n    url: https://api.twitter.com/register,\n    method: POST\n  `\n}\n\ntwitter.register`\n  body: ${{\n    email: 'test@test.com',\n    password: 'Tester'\n  }}\n`\n```\n\n### Middleware\n\n**Coming Soon** The following isn't implemented yet.\n\n\n```js\nimport request from 'legible'\n\nrequest.middleware({\n  headers: {\n    Authorization: `Bearer: ${localStorage.getItem('token')}`\n  },\n  after({ headers }) {\n    localStorage.setItem('token', headers.Authorization)\n  }\n})\n```\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n| [\u003cimg src=\"https://avatars.githubusercontent.com/u/449136?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eZach Silveira\u003c/sub\u003e](http://reactjsnews.com)\u003cbr /\u003e[💻](https://github.com/Legitcode/legible/commits?author=zackify) [📖](https://github.com/Legitcode/legible/commits?author=zackify) 👀 | [\u003cimg src=\"https://avatars.githubusercontent.com/u/5465958?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eRay Gesualdo\u003c/sub\u003e](https://github.com/raygesualdo)\u003cbr /\u003e[💻](https://github.com/Legitcode/legible/commits?author=raygesualdo) [📖](https://github.com/Legitcode/legible/commits?author=raygesualdo) |\n| :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegitcode%2Flegible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flegitcode%2Flegible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegitcode%2Flegible/lists"}