# handlebars-faker-loader

> A webpack plugin for handlebars and fakers JSON

Latest version **1.0.4** (published 2019-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install handlebars-faker-loader
pnpm add handlebars-faker-loader
yarn add handlebars-faker-loader
bun add handlebars-faker-loader
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-09-19 |
| First published | 2019-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mario Redonavich Garbey |
| Maintainers | shacco |
| Keywords | webpack, loader, handlebars |

## Links

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

## Dependencies (1)

- [clear-require](https://npm.io/package/clear-require.md) ^3.0.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2019-09-19
- 1.0.3 — 2019-09-18
- 1.0.2 — 2019-09-18
- 1.0.1 — 2019-09-18
- 1.0.0 — 2019-09-18

## README

# Handlebars faker loader
This is an special webpack loader for handlebars 
## How to use
`yarn add --dev handlebars-faker-loader handlebars`
```
{
    test: /(\.faker\.js|\.handlebars)$/,
    use: [
        {
            loader: 'file-loader',
            options: {
                name(file) {
                    let finalName = /[\d\w_]+(\.faker\.js|\.handlebars)$/i.exec(file)[0].replace('.handlebars','.html').replace('.faker.js','.html')
                    return finalName;
                }
            }
        },
        {
            loader:'handlebars-faker-loader',
            options: {
                fakersDir:path.resolve(__dirname, 'src/fakers/'),
                viewsDir:path.resolve(__dirname, 'src/views/'),
                doNothing: true //(Optinal) If you dont want the puglin to act for some reason,
            }
        }
    ]
}
```
### Faker example
```
    module.exports =()=>{
        return {
            lorem:'mama mia '
        };
    }
```
You have to name the file with the extension `.faker.js`, 
and the handlebars with the extension `.handlebars`

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