Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enkot/nuxt-open-fetch
Generate zero-overhead, typed OpenAPI clients for Nuxt.
https://github.com/enkot/nuxt-open-fetch
api composable fetch nuxt nuxt3 openapi query
Last synced: about 5 hours ago
JSON representation
Generate zero-overhead, typed OpenAPI clients for Nuxt.
- Host: GitHub
- URL: https://github.com/enkot/nuxt-open-fetch
- Owner: enkot
- License: mit
- Created: 2023-09-19T07:43:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-01T00:29:50.000Z (19 days ago)
- Last Synced: 2024-11-19T14:05:01.402Z (about 8 hours ago)
- Topics: api, composable, fetch, nuxt, nuxt3, openapi, query
- Language: TypeScript
- Homepage: https://nuxt-open-fetch.vercel.app
- Size: 3.66 MB
- Stars: 148
- Watchers: 3
- Forks: 14
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Nuxt Open Fetch](./docs/public/cover.png)](https://nuxt-open-fetch.vercel.app/)
# Nuxt Open Fetch
[![npm version][npm-version-src]][npm-version-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]Generate zero-overhead, 100% typed OpenAPI clients for Nuxt.
In other words - `$fetch` and `useFetch` on steroids. Uses awesome [openapi-typescript](https://github.com/drwpow/openapi-typescript) generator under the hood.
> ⚠️ APIs are subject to change.
> All ideas/suggestions are welcome! :)- [✨ Release Notes](/CHANGELOG.md)
- [📖 Read the documentation](https://nuxt-open-fetch.vercel.app/)## Features
- 🍹 No manual typing of your API
- 🍋 Supports OpenAPI 3.0 and 3.1 (including advanced features like [discriminators](https://spec.openapis.org/oas/v3.1.0#discriminator-object))
- 🌲 Uses runtime-free types that outperform old-school codegen
- 📡 Load schemas from YAML or JSON, locally or remotely
- 🥞 Works with Nuxt [Layers](https://nuxt.com/docs/getting-started/layers)## Quick Setup
1. Add `nuxt-open-fetch` dependency to your project
```bash
# Using pnpm
pnpm add -D nuxt-open-fetch# Using yarn
yarn add --dev nuxt-open-fetch# Using npm
npm install --save-dev nuxt-open-fetch
```2. Add `nuxt-open-fetch` to the `modules` section of `nuxt.config.ts`
```js
export default defineNuxtConfig({
modules: [
'nuxt-open-fetch'
]
})
```That's it! You can now use `nuxt-open-fetch` in your Nuxt app ✨
## Development
```bash
# Install dependencies
pnpm install# Generate type stubs
pnpm dev:prepare# Develop with the playground
pnpm dev# Build the playground
pnpm dev:build# Run ESLint
pnpm lint# Run Vitest
pnpm test
pnpm test:watch# Release new version
pnpm release
```## License
Made with 💚
Published under the [MIT License](./LICENCE).
[npm-version-src]: https://img.shields.io/npm/v/nuxt-open-fetch/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-open-fetch[license-src]: https://img.shields.io/npm/l/nuxt-open-fetch.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-open-fetch[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com