# faker-nuxt

> A Faker wrapper for Nuxt.

Latest version **7.1.0** (published 2022-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install faker-nuxt
pnpm add faker-nuxt
yarn add faker-nuxt
bun add faker-nuxt
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.1.0 |
| Published | 2022-05-31 |
| First published | 2020-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 38.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Antonio Eduardo |
| Maintainers | skyatura |
| Keywords | faker, nuxt |

## Links

- npm: https://www.npmjs.com/package/faker-nuxt
- Repository: https://github.com/SkyaTura/faker-nuxt
- Homepage: https://github.com/SkyaTura/faker-nuxt#readme
- Issues: https://github.com/SkyaTura/faker-nuxt/issues
- npm.io page: https://npm.io/package/faker-nuxt

## Dependencies (1)

- [@faker-js/faker](https://npm.io/package/@faker-js/faker.md) ^7.1.0

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@massiv-oss/grpc-fake-server](https://npm.io/package/@massiv-oss/grpc-fake-server.md) — 0 weekly downloads
- [@buoy-gg/location](https://npm.io/package/@buoy-gg/location.md) — 0 weekly downloads
- [ng-postcode](https://npm.io/package/ng-postcode.md) — 0 weekly downloads

## Recent versions

- 7.1.0 (latest) — 2022-05-31
- 6.0.0-alpha.6 — 2022-02-16
- 6.0.0-alpha.5 — 2022-01-27
- 1.0.2 — 2020-07-20
- 1.0.1 — 2020-06-29
- 1.0.0 — 2020-06-29

## README

# faker-nuxt

> [Faker](https://www.npmjs.com/package/@faker-js/faker) wrapper for [Nuxt.js](https://nuxtjs.org/)

[![version](https://img.shields.io/npm/v/faker-nuxt?label=faker-nuxt)](https://www.npmjs.com/package/faker-nuxt)
[![npm (scoped)](https://img.shields.io/npm/v/@faker-js/faker?label=@faker-js/faker)](https://www.npmjs.com/package/@faker-js/faker)
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/faker-nuxt)
![node-current (scoped)](https://img.shields.io/node/v/@faker-js/faker)
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/faker-nuxt)
[![gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)

## Features

- Inject `$faker` to the context everywhere.

## Setup

1. Add `faker-nuxt` dependency to your project

```bash
npm install --save-dev faker-nuxt # or yarn add --dev faker-nuxt
```

2. Add `faker-nuxt` to the `buildModules` section of `nuxt.config.js`

```js
export default {
  buildModules: [
    // Simple usage
    'faker-nuxt',

    // With options
    ['faker-nuxt', { /* module options */ }]
  ]
}
```

:warning: If you are using Nuxt **< v2.9** you have to install the module as a `dependency` (No `--dev` or `--save-dev` flags) and use `modules` section in `nuxt.config.js` instead of `buildModules`.

### Using top level options

```js
export default {
  buildModules: [
    'faker-nuxt'
  ],
  faker: {
    /* module options */
  }
}
```

## Configuration

### Set default locale

You can set a default locale via the `locale` option.

```js
export default {
  buildModules: [
    'faker-nuxt'
  ],
  faker: {
    locale: 'pt_BR',
  }
}
```

### Set default seed

You can set a default seed via the `seed` option.

```js
export default {
  buildModules: [
    'faker-nuxt'
  ],
  faker: {
    seed: 'Banana123',
  }
}
```

## Usage

### Using inside templates

```html
<div>{{ $faker.lorem.word() }}</div>
<div v-text="$faker.lorem.words()"></div>
```

### Using inside scripts

```html
<script>
  export default {
    data() {
      return {
        name: this.$faker.fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}')
      }
    }
  }
</script>
```

---
_Source: https://npm.io/package/faker-nuxt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
