broccoli-json-transform
Broccoli plugin that allows for JSON files to be modified by using a transform.
Installation
npm install --save-dev broccoli-json-transform
Usage
var JsonTransform = ; var tranformedJson = 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
:
"foo": "bar"
And this is your build pipeline:
var JsonTransform = ; { var result = {}; var keys = Object; forvar i = 0; i < keyslength; ++i var key = keysi; resultkey = objkey; return result;} var tranformedJson = inputNode transform: capitalizeKeys ;
Then the output example.json
will look like this:
"FOO": "bar"
Contributing
Clone this repo and run the tests like so:
npm install
npm test