0.2.0 • Published 1 year ago

nuxt3-date-fns v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

💡 About

date-fns auto-import module for Nuxt.

📦 Install

  1. Install nuxt-date-fns as development dependency:
npm i nuxt3-date-fns -D
yarn add nuxt3-date-fns -D
pnpm i nuxt3-date-fns -D
  1. Add it to the modules section of your nuxt.config:
export default defineNuxtConfig({
  modules: ["nuxt3-date-fns"],
});

🚀 Example

Use any Date-Fns methods in your Nuxt application, they will be auto-imported!

<script setup>
  const date = useFormat(new Date(2024, 1, 11), "MM/dd/yyyy");
</script>

<template>
  <div>{{ date }}</div>
</template>

🔨 Config

NameDefaultDescription
prefix'use'String to prepend before each date-fns function (false to disable)

💻 Example - Config

export default defineNuxtConfig({
  modules: ["nuxt3-date-fns"],
  "date-fns": {
    prefix: "_",
  },
});

📄 License

MIT License © 2024 - Siddharth Sarathe

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago