Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ttiimmothy/react-api-clients
A npm package for calling APIs in React app
https://github.com/ttiimmothy/react-api-clients
npm-package react
Last synced: about 1 month ago
JSON representation
A npm package for calling APIs in React app
- Host: GitHub
- URL: https://github.com/ttiimmothy/react-api-clients
- Owner: ttiimmothy
- License: apache-2.0
- Created: 2024-09-06T23:36:47.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T02:45:22.000Z (2 months ago)
- Last Synced: 2024-09-28T15:21:08.879Z (about 2 months ago)
- Topics: npm-package, react
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Api Clients
[![npm version](https://img.shields.io/npm/v/react-api-clients.svg)](https://www.npmjs.com/package/react-api-clients)
A npm package for calling APIs in React.
## For building the package
```bash
npm pkg set main="lib/index.js" types="lib/index.d.ts" scripts.build="tsc" scripts.prepare="npm run build"
```## Publishing
To publish a new version of the package:
1. Update the version in package.json
```bash
npm version patch
```2. Publish to npm
```bash
npm publish
```## For using the package
```bash
npm install react-api-clients
# or
yarn add react-api-clients
# or
pnpm add react-api-clients
# or
bun add react-api-clients
```### Installation
You can install this package from GitHub Packages
```bash
npm install @ttiimmothy/react-api-clients
# or
yarn add @ttiimmothy/react-api-clients
# or
pnpm add @ttiimmothy/react-api-clients
# or
bun add @ttiimmothy/react-api-clients
```## Usage
```ts
import { callApi } from "react-api-clients";const data = await callApi("https://jsonplaceholder.typicode.com/todos/1");
```## License
React Api Clients is licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for more details.