# gulp-json-modify

> Modify data on a JSON path using Gulp (gulpjs.com)

Latest version **1.0.2** (published 2016-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-json-modify
pnpm add gulp-json-modify
yarn add gulp-json-modify
bun add gulp-json-modify
```

## 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.2 |
| Published | 2016-06-04 |
| First published | 2016-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.9.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lloyd Watkin |
| Maintainers | lloydwatkin |
| Keywords | gulp, gulpplugin, version, versioning, gulp-version, gulp-plugin, json |

## Links

- npm: https://www.npmjs.com/package/gulp-json-modify
- Repository: https://github.com/olioex/gulp-json-modify
- Homepage: http://github.com/olioex/gulp-json-modify
- Issues: https://github.com/olioex/gulp-json-modify/issues
- npm.io page: https://npm.io/package/gulp-json-modify

## Dependencies (4)

- [through2](https://npm.io/package/through2.md) ^0.5.1
- [dot-object](https://npm.io/package/dot-object.md) ^1.2.0
- [plugin-log](https://npm.io/package/plugin-log.md) ^0.1.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^0.1.2

## 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

- 1.0.2 (latest) — 2016-06-04

## README

# gulp-json-modify

[![Build Status](https://travis-ci.org/OLIOEX/gulp-json-modify.png?branch=master)](https://travis-ci.org/OLIOEX/gulp-json-modify)

[![NPM version](https://badge.fury.io/js/gulp-json-modify.png)](http://badge.fury.io/js/gulp-json-modify)

> Replace data in a JSON file with something else

## Usage

#### Install

```bash
$ npm install gulp-json-modify --save
```

## Example

```js
// jsonModify data in multiple files
gulp.task('jsonModify', function () {

  return gulp.src([ './bower.json', './package.json' ])
    .pipe(tasks.jsonModify({
      key: 'version',
      value: '1.0.0'
    }))
    .pipe(gulp.dest('./'))

})

// Run the gulp tasks
gulp.task('default', function(){
  gulp.run('jsonModify')
})
```

## Options

* **key**: key to replace (required)
* **value**: set to value (required)

Example:

```js
.pipe(jsonModify({ key: 'app_id', value: '1234' })
```

##### Dot notation is supported for sub-keys

```js

.pipe(jsonModify({ key: 'key.subkey', value: 'set-me-to' }))

/*
{
  "key": {
    "subkey": "<value>"
  }
}
*/
```

### options.indent

Set the amount of spaces for indentation in the result JSON file.

## /ht

https://github.com/stevelacy/gulp-bump

## LICENSE

(MIT License)

Copyright (c) 2015 Steve Lacy <me@slacy.me> slacy.me

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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