# emit-json-file-webpack-plugin

> Creates a json file from a JavaScript object during the Webpack Building Process

Latest version **0.1.0** (published 2017-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install emit-json-file-webpack-plugin
pnpm add emit-json-file-webpack-plugin
yarn add emit-json-file-webpack-plugin
bun add emit-json-file-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-10-20 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thomas Wirth |
| Maintainers | wtho |
| Keywords | webpack, json, js-object |

## Links

- npm: https://www.npmjs.com/package/emit-json-file-webpack-plugin
- Repository: https://github.com/wtho/emit-json-file-webpack-plugin
- Homepage: https://github.com/wtho/emit-json-file-webpack-plugin#readme
- Issues: https://github.com/wtho/emit-json-file-webpack-plugin/issues
- npm.io page: https://npm.io/package/emit-json-file-webpack-plugin

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-10-20

## README

[![npm](https://img.shields.io/npm/v/emit-json-file-webpack-plugin.svg?style=flat-square)](https://npmjs.com/package/emit-json-file-webpack-plugin)

<div align="center">
  <a href="https://github.com/webpack/webpack">
    <img width="200" height="200"
      src="https://webpack.js.org/assets/icon-square-big.svg">
  </a>
  <h1>Emit Json-File Webpack Plugin</h1>
  <p>Creates a json file from a JavaScript object during the Webpack Building Process.</p>
</div>

### Install

```
npm i -D emit-json-file-webpack-plugin
```

### Usage

`new EmitJsonFileWebpackPlugin([files])`

A file looks like:
`{ path: 'filePath', content: 'object' }`

| Name | Details                                                 |
|------|---------------------------------------------------------|
| `path` | This file path will created inside the Output Directory <br>_example:_ 'folder/file.txt'|
| `content`   | The JavaScript object to be formatted as JSON. The Plugin uses [json-format](https://github.com/luizstacio/json-format) internally to format the object. |

### Examples

```javascript
const EmitJsonFileWebpackPlugin = require('emit-json-file-webpack-plugin')

const fileContent = {
    importantValueA: 'A',
    valueB: 'B'
}

module.exports = {
    ...
    plugins: [
        new EmitJsonFileWebpackPlugin([
            // {output}/folder/file.txt
            { path: 'folder/file.txt', content: fileContent },
        ])
    ]
}
```

---
_Source: https://npm.io/package/emit-json-file-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
