nuxt-server-utils
nuxt-server-utils copied to clipboard
A collection of utilities for Nuxt server.
🛠️ Nuxt Server Utils
A collection of utility functions for Nuxt API development.
- ✨ Release Notes
- 🏀 Online playground
- 📖 Documentation
Features
Filtering Collections (Mongoose)
- [x] Filtering
- [x] Sorting
- [x] Pagination
- [x] Selecting
- [x] Populating
- [x] Counting
- [x] Searching
Authorization
- [x] Authority checker utility
- [ ] Permission checker utility
- [ ] Policy utility
Resource Helper
- [x] Resource index utility
- [x] Resource show utility
- [x] Resource delete utility
- [ ] Resource update utility
Validation
- [x] Zod schema validator
Quick Setup
- Add
nuxt-server-utils
dependency to your project
# Using pnpm
pnpm add -D nuxt-server-utils
# Using yarn
yarn add --dev nuxt-server-utils
# Using npm
npm install --save-dev nuxt-server-utils
- Add
nuxt-server-utils
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-server-utils"],
});
That's it! You can now use Nuxt Server Utils in your Nuxt app ✨
Development
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release