<img src="jafar.png" height="200">

# jafar

#### JSON Find and Replace

<img src="jafar.png" height="200">

# jafar

#### JSON Find and Replace

If you've ever wanted to perform find/replace operations on JSON data structures,
jafar is for you! Find and replace keys and values using a regex-based set of
methods that allow you to easily transform JSON while preserving the structure. No
more awful stringifying/regexing/parsing steps!

### Initialization

Initialize jafar with either a reference to a .json file or an actual JSON structure:

```js
var jafar = new Jafar({
    json: './test/sample.json'
});

// or:

var jafar = new Jafar({
    json: {
        "thing": {
            "another": "somethingsomething"
        },
        "thing2": {
            "another2": "something2"
        },
        "thing3": {
            "thing4": {
                "thing5thing5": "something3"
            }
        }
    }
});
```

`jafar` will be instantiated with a `json` property, which will be transformed when
performing find/replace operations:

```js
jafar.json
```

### Methods

```js
jafar.listAllKeys()
```

```js
jafar.findKey()
```

```js
jafar.replaceKey()
```

```js
jafar.listAllValues()
```

```js
jafar.findValue()
```

```js
jafar.replaceValue()
```

Add outline of readme file and summary
Add outline of readme file and summary