Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Ky | 9,846 | 875 | 260 | 20 days ago | 53 | September 03, 2022 | 48 | mit | TypeScript | |
🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API | ||||||||||
Wretch | 3,941 | 48 | 56 | 13 days ago | 52 | September 27, 2022 | 3 | mit | TypeScript | |
A tiny wrapper built around fetch with an intuitive syntax. :candy: | ||||||||||
Vue Json Excel | 617 | 52 | 28 | a year ago | 43 | October 05, 2020 | 66 | mit | Vue | |
Fakerest | 399 | 141 | 29 | 3 months ago | 25 | March 29, 2021 | 5 | mit | JavaScript | |
Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data. | ||||||||||
Ffq | 378 | 8 months ago | 9 | May 05, 2022 | mit | Python | ||||
A tool to find sequencing data and metadata from public databases. | ||||||||||
Dms | 152 | a year ago | 22 | mit | JavaScript | |||||
基于Json Schema的动态Json数据配置平台 | ||||||||||
Vanilla Js | 144 | a month ago | 1 | JavaScript | ||||||
Projects using pure JavaScript without any external libraries or frameworks | ||||||||||
Fetch Polyfill | 140 | 14 | 2 | 6 years ago | 3 | November 01, 2016 | 3 | JavaScript | ||
fetch polyfill which supports all mainstream browsers, even IE6, IE7, IE8..... | ||||||||||
Fetch Plus | 116 | 33 | 14 | 3 years ago | 20 | November 21, 2016 | 30 | other | JavaScript | |
🐕 Fetch+ is a convenient Fetch API replacement with first-class middleware support. | ||||||||||
Hades | 93 | 4 years ago | 1 | mit | Go | |||||
Hades is a hypermedia-based HTTP/2 reverse proxy for JSON:API servers. |
A convenient Fetch API library with first-class middleware support.
myHeaders: () => values
npm install --save fetch-plus isomorphic-fetch
npm install --save fetch-plus-basicauth
npm install --save fetch-plus-bearerauth
npm install --save fetch-plus-csrf
npm install --save fetch-plus-immutable
npm install --save fetch-plus-json
npm install --save fetch-plus-oauth
npm install --save fetch-plus-stream
npm install --save fetch-plus-useragent
npm install --save fetch-plus-xml
import/require
import {fetch, createClient} from "fetch-plus";
fetch
fetch("http://some.api.example/v1", {
query: {foo: "bar"}, // Query string object. So convenient.
body: () => "R2-D2" // Computed values are computed.
});
createClient
Creates a RESTful client so middlewares can be added to it.
const client = createClient("http://some.api.example/v1");
client.addMiddleware
Create middlewares like: (request) => (response) => response
client.addMiddleware(
(request) => {
request.path += ".json";
request.options.headers["Content-Type"] = "application/json; charset=utf-8";
return (response) => response.json();
}
);
client.request
request
performs generic requests to the configured endpoint.
client.request("posts/25/comments", {
method: "POST",
body: {comment: "C-3PO"}
});
client.browse|read|edit|add|destroy|replace
BREAD helpers that perform requests to the configured endpoint.
client.browse(
"posts" // A string...
);
client.add(
["posts", 1, "comments"], // ...or an array like ["posts", id, "comments"]
{body: "C-3PO"} // Regular Fetch API body option.
);
client.list|create|read|update|destroy
CRUD aliases that perform requests to the configured endpoint.
client.list(
"posts" // A string...
);
client.create(
["posts", 1, "comments"], // ...or an array like ["posts", id, "comments"]
{body: "C-3PO"} // Regular Fetch API body option.
);
handlers
Handlers take configuration and return functions to pass to .then()
.
// Transform JSON with fetch-plus-json.
import plusJson from "fetch-plus-json";
fetch("http://some.api.example/v1/posts").then(plusJson.handler({some:"config"}));
See example for more.
Let's start one together! After you ★Star this project, follow me @Rygu on Twitter.
BSD 3-Clause license. Copyright © 2015, Rick Wong. All rights reserved.