nuxt-datefns-module
v0.0.2
Published
date-fns integration for Nuxt
Downloads
3
Readme
Nuxt Date Fns
Nuxt module for date-fns
Features
- Auto import date-fns utilities
- Powered by TypeScript
Quick Setup
Install the module to your Nuxt application with one command:
npx nuxi module add nuxt-datefns-moduleThat's it! You can now use Nuxt Datefns in your Nuxt app ✨
Usage
Just refer to the official documentation. Instead of importing utilities manually, simply use the functions prefixed with "use", for example:
- format -> useFormat
- isAfter -> useIsAfter
Component prefix in customizable in the nuxt config, by creating a custom configuration:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-datefns-module"],
"date-fns": {
prefix: "foo" // useFormat -> fooFormat
}
// ...
});Find out an example in the playground
Contribution
# Install dependencies
bun install
# Generate type stubs
bun run dev:prepare
# Develop with the playground
bun run dev
# Build the playground
bun run dev:build
# Run ESLint
bun run lint
# Release new version
bun run release