Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Module Listing Request]: nuxt-radash #712

Closed
bbg opened this issue Jul 26, 2023 · 1 comment · Fixed by #713
Closed

[Module Listing Request]: nuxt-radash #712

bbg opened this issue Jul 26, 2023 · 1 comment · Fixed by #713

Comments

@bbg
Copy link
Contributor

bbg commented Jul 26, 2023

Description

Description

nuxt-radash.yml

name: radash
description: radash module with auto-import and custom prefix
repo: bbg/nuxt-radash
npm: nuxt-radash
icon: radash.svg
github: https://github.com/bbg/nuxt-radash
website: https://github.com/bbg/nuxt-radash#readme
learn_more: https://github.com/rayepps/radash/
category: Libraries
type: 3rd-party
maintainers:
  - name: Batuhan Göksu
    github: bbg
compatibility:
  nuxt: ^3.0.0
  requires: {}

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-Lodash.

📄 License

MIT License © 2023 - Batuhan Göksu

Repository

https://github.com/bbg/nuxt-radash

npm

https://www.npmjs.com/~bbg0x

Nuxt Compatibility

Nuxt 3

@bbg
Copy link
Contributor Author

bbg commented Jul 27, 2023

@atinux could you please check?

PR: #713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant