nuxt-radash

radash for Nuxt
10,601 20
Install
npm install nuxt-radash
Latest Version:1.0.0
Vue:3
License:MIT
Last Updated:Jun 14, 2024
Links: GitHub  ·  npm
Maintainer: bbg0x

Radash for Nuxt

Radash auto-import module for Nuxt.

📦 Install

Install nuxt-radash as development dependency:

npm i nuxt-radash -D

Add it to the modules section of your nuxt.config:

export default defineNuxtConfig({
  modules: ["nuxt-radash"],
});

🚀 Example

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

<script setup>
const fish = [
  {
    name: "Marlin",
    weight: 105,
    source: "ocean",
  },
  {
    name: "Bass",
    weight: 8,
    source: "lake",
  },
  {
    name: "Trout",
    weight: 1,
    source: "lake",
  },
];

const ra = {
  Mode: "god",
  Power: "sun",
};

const min = useMin(fish, (f) => f.weight);
const text = usePascal("it works!");
const lowerize = useLowerize(ra);
const snake = stringToSnake('green fish blue fish')
</script>

<template>
  <div>{{ text }}</div>
  <pre>{{ min }}</pre>
  <pre>{{ lowerize }}</pre>
  <pre>{{ snake }}</pre>
</template>

🔨 Config

Name Default Description
prefix 'use' String to prepend before each Radash function (false to disable)
prefixSkip 'is' Functions that starts with this keywords will be skipped by prefix (false to disable)
upperAfterPrefix true If true it will automatically uppercase first letter after prefix (false to disable)
alias [] Array of array pairs to rename specific Radash functions (prefix is still added)

💻 Example - Config

export default defineNuxtConfig({
  modules: ["nuxt-radash"],
   radash: {
    prefix: '_',
    prefixSkip: ['string'],
    upperAfterPrefix: true,
    alias: [
      ['snake', 'stringToSnake'], // => stringToSnake
    ]
  }
});

Acknowledgement

The development of nuxt-radash was made possible thanks to the inspiration and code base from Nuxt-Radash.

📄 License

MIT License © 2021-2022 - Batuhan Göksu

Related Packages

@privyid/nuxt-csrf

Module CSRF for NUXT

26,088 9
mixpanel-nuxt

Mixpanel module for Nuxt

19,992 7
gsap-nuxt-module

GSAP integration for Nuxt.

8,932 37
@docus/core-edge

The Docus core.

8,638
@docus/app-edge

The Docus default app.

8,488

Version History

Version Released Vue License
1.0.0 ^3.0 MIT