https://github.com/bbg/nuxt-radash
Radash module for Nuxt
https://github.com/bbg/nuxt-radash
Last synced: about 1 year ago
JSON representation
Radash module for Nuxt
- Host: GitHub
- URL: https://github.com/bbg/nuxt-radash
- Owner: bbg
- License: mit
- Created: 2023-07-26T08:27:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-14T13:18:35.000Z (about 2 years ago)
- Last Synced: 2025-04-08T17:05:17.671Z (about 1 year ago)
- Language: TypeScript
- Size: 131 KB
- Stars: 20
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Radash for Nuxt
[Radash](https://radash-docs.vercel.app) auto-import module for [Nuxt](https://nuxtjs.org).
## π¦ Install
Install `nuxt-radash` as development dependency:
```bash
npm i nuxt-radash -D
```
Add it to the `modules` section of your `nuxt.config`:
```ts
export default defineNuxtConfig({
modules: ["nuxt-radash"],
});
```
## π Example
Use any [Radash](https://radash-docs.vercel.app/) methods in your Nuxt application, they will be auto-imported!
```html
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')
{{ text }}
{{ min }}
{{ lowerize }}
{{ snake }}
```
## π¨ 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
```ts
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](https://github.com/cipami/nuxt-lodash).
## π License
[MIT License](https://github.com/bbg/nuxt-radash/blob/master/LICENSE) Β© 2023 - [Batuhan GΓΆksu](https://github.com/bbg)