# broccoli-json-transform

> Broccoli plugin that allows for JSON files to be modified by using a transform

Latest version **0.0.1** (published 2017-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-json-transform
pnpm add broccoli-json-transform
yarn add broccoli-json-transform
bun add broccoli-json-transform
```

## 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.0.1 |
| Published | 2017-02-12 |
| First published | 2017-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zack Mulgrew |
| Maintainers | zackthehuman |
| Keywords | broccoli, json |

## Links

- npm: https://www.npmjs.com/package/broccoli-json-transform
- npm.io page: https://npm.io/package/broccoli-json-transform

## Dependencies (1)

- [broccoli-filter](https://npm.io/package/broccoli-filter.md) ^1.2.4

## Recent versions

- 0.0.1 (latest) — 2017-02-12

## README

# broccoli-json-transform
Broccoli plugin that allows for JSON files to be modified by using a transform.

## Installation

```bash
npm install --save-dev broccoli-json-transform
```

## Usage

```js
var JsonTransform = require('broccoli-json-transform');

var tranformedJson = new JsonTransform(inputNode, options);
```

* **`inputNode`**: A broccoli node

* **`options`**: A hash of options

### Options

* `transform`: The function used to transform the JSON content. Should return
               an object.

* `space`: Optional. String or number. Used when stringifying the JSON.

### Example

If this is your `example.json`:

```js
{
  "foo": "bar"
}
```

And this is your build pipeline:

```js
var JsonTransform = require('broccoli-json-transform');

function capitalizeKeys(obj) {
  var result = {};
  var keys = Object.keys(obj);

  for(var i = 0; i < keys.length; ++i) {
    var key = keys[i];
    result[key.toUpperCase()] = obj[key];
  }

  return result;
}

var tranformedJson = new JsonTransform(inputNode, { transform: capitalizeKeys });
```

Then the output `example.json` will look like this:

```js
{
  "FOO": "bar"
}
```

## Contributing

Clone this repo and run the tests like so:

```
npm install
npm test
```

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