@echojs-ecosystem/network
v0.9.0
Published
EchoJS network toolkit — tree-shakeable HTTP, WebSocket, GraphQL, and mock subpath imports
Readme
@echojs-ecosystem/network
Tree-shakeable network toolkit for EchoJS apps. Import only the submodule you need.
Install
npm i @echojs-ecosystem/networkSubpath imports
| Import | Description |
| --- | --- |
| @echojs-ecosystem/network/http | HTTP client |
| @echojs-ecosystem/network/ws | WebSocket client (stub) |
| @echojs-ecosystem/network/mock | Request mocking utilities (stub) |
| @echojs-ecosystem/network/graphql | GraphQL client (stub) |
Via the framework meta-package:
import { createHttpClient } from "@echojs-ecosystem/framework/network/http";HTTP quick start
import { createHttpClient } from "@echojs-ecosystem/network/http";
const client = createHttpClient({
baseUrl: "https://api.example.com",
});
const { data } = await client.get("/users").json<User[]>();