{"_id":"grunt-update-json","_rev":"23-d9a7baa242fc860d816bfae235bcc84d","name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.1.0","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":"","repository":{"type":"git","url":"git://github.com/andreaspizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/andreaspizsa/grunt-update-json/issues"},"licenses":[{"type":"MIT","url":"https://github.com/andreaspizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","merge","update","sync","bower.json","component.json"],"dependencies":{"lodash":"~2.4.1"},"_id":"grunt-update-json@0.1.0","dist":{"shasum":"cfccce4b5576cdc3b2ebbef87a372c4e6e908d64","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.1.0.tgz","integrity":"sha512-07YxLbf0rUD94629tTHT0Lo6JTvJA+CmLCREJnE5uKwgOyHZl8crWs4c3zIBRJ1FyUIFDHDEGWCcn+H51tLMMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhCORpYfho4HlbScdghURk4SAfYjr8mzMxBiIAEl8ecAiEAnXLwZYqnQiecCd/Rkg81ExB9/9gA+ozHWmwYXkixnwo="}]},"_from":".","_npmVersion":"1.3.10","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}]},"0.1.1":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.1.1","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":"","repository":{"type":"git","url":"git://github.com/andreaspizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/andreaspizsa/grunt-update-json/issues"},"licenses":[{"type":"MIT","url":"https://github.com/andreaspizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","merge","update","sync","bower.json","component.json"],"dependencies":{"lodash":"~2.4.1"},"_id":"grunt-update-json@0.1.1","dist":{"shasum":"87830df020a72210142502ad5f1c5b2ed9aa3751","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.1.1.tgz","integrity":"sha512-G8380I7g45e4NyUklVP0gHDv0tBkvWm3T2G9WA5G0dWI6KOIzh7sMgc4m9RDREAycuv41fwQXFiBbkE5j8/YLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6Z6GBom+PsPnN0nWXuj/ds6/W8pdyPJEOgFJW6MsTbAiBOOx2aWqU5dxPdUC5eJia9qTEZVnGZ8yIn938oQqTlCA=="}]},"_from":".","_npmVersion":"1.3.10","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}]},"0.1.2":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.1.2","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":"","repository":{"type":"git","url":"git://github.com/andreaspizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/andreaspizsa/grunt-update-json/issues"},"licenses":[{"type":"MIT","url":"https://github.com/andreaspizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","merge","update","sync","bower.json","component.json"],"dependencies":{"lodash":"~2.4.1"},"_id":"grunt-update-json@0.1.2","dist":{"shasum":"cc5d57cc0cb59a1f84ef7d388dabd09696537dc4","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.1.2.tgz","integrity":"sha512-x9v1KLtVkyMlvbHI08sW8+TYD1SYTka0ZNRz7hSyl22U39dqmhoNrK9pD7HZE6WcrWRNCgjZu8SvpmZO866G7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnu1QvCL03IXgywySC3spasCVzw0APYVbbbEtv+FLQBwIgZdkrdm54fbn5Gjm7jzW95ifaomy5eZod9dfWTx8NPw0="}]},"_from":".","_npmVersion":"1.3.10","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}]},"0.1.3":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.1.3","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":"","repository":{"type":"git","url":"git://github.com/andreaspizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/andreaspizsa/grunt-update-json/issues"},"licenses":[{"type":"MIT","url":"https://github.com/andreaspizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","merge","update","sync","bower.json","component.json"],"dependencies":{"lodash":"~2.4.1"},"_id":"grunt-update-json@0.1.3","dist":{"shasum":"c8fb6f4b191b822fcca70ab51aca85ffd83ebb83","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.1.3.tgz","integrity":"sha512-NVE4+XAVaM7t8o09cZ9Aoxeyz8hpcv1aSzQ5XQ0jbLv1MGFYXhZXQYStge4L7qoPJkELeeeggmG+Tq7AEYTpCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGW7SGVNycLH66WdORtrWh2T5Wiw1OTbI/2AHAA4EbBWAiEApcz5jkourHxRQbHM8mUNLNZBK2gJJiFJQcU4jlR5ais="}]},"_from":".","_npmVersion":"1.3.10","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}]},"0.2.0":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.2.0","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":"","repository":{"type":"git","url":"git://github.com/andreaspizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/andreaspizsa/grunt-update-json/issues"},"licenses":[{"type":"MIT","url":"https://github.com/andreaspizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"blanket":"~1.1.6","chai":"~1.9.1","grunt":"~0.4.2","grunt-contrib-clean":"~0.4.0","grunt-contrib-copy":"~0.5.0","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.6.1","grunt-mocha-cov":"~0.2.1","load-grunt-tasks":"~0.4.0","mocha-term-cov-reporter":"~0.2.0","should":"~3.3.1"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","json pointer","merge","update","sync","bower.json","component.json","composer.json"],"dependencies":{"json-pointer":"~0.1.0","lodash":"~2.4.1","JSONPath":"~0.10.0"},"config":{"blanket":{"pattern":["grunt-update-json/tasks"]}},"gitHead":"21dfc05564b693f3caccf247061d3ffc9653a9a8","_id":"grunt-update-json@0.2.0","_shasum":"f6c664d992d5caffa010240fee0efc6157048583","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.26","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}],"dist":{"shasum":"f6c664d992d5caffa010240fee0efc6157048583","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.2.0.tgz","integrity":"sha512-WTVT2DfKr2YSmhTWlSe0ogbyeiOd35jJaNIoSKaL2BXjyuiwtpyssdNh5xTfqlNmsHd2valCYFsgs8kS1T9A4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF07KTv/vGC+NZonIvviQiCkJ5/sXTEg5YxLoKr3rmIgIhAOJpK/EqYkzZ6pca+IzDAh3QOjsyiGApfh+Dqfocw+Rd"}]}},"0.2.1":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.2.1","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":{"name":"Andreas Pizsa","url":"http://github.com/AndreasPizsa"},"contributors":[{"name":"bollwyvl","url":"https://github.com/bollwyvl"},{"name":"Vasyl Zuzyak","url":"https://github.com/ZuBB"},{"name":"Andrew Dryga","url":"https://github.com/AndrewDryga"}],"repository":{"type":"git","url":"git://github.com/AndreasPizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/AndreasPizsa/grunt-update-json/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"https://github.com/AndreasPizsa/grunt-update-json/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"blanket":"~1.1.6","chai":"~1.9.1","grunt":"~0.4.2","grunt-contrib-clean":"~0.4.0","grunt-contrib-copy":"~0.5.0","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.6.1","grunt-mocha-cov":"~0.2.1","load-grunt-tasks":"~0.4.0","mocha-term-cov-reporter":"~0.2.0","should":"~3.3.1"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","json pointer","merge","update","sync","bower.json","component.json","composer.json"],"dependencies":{"JSONPath":"~0.10.0","json-pointer":"~0.1.0","json-stable-stringify":"^1.0.0","lodash":"~2.4.1"},"config":{"blanket":{"pattern":["grunt-update-json/tasks"]}},"gitHead":"47f954fd42d6aa4a2858b9965c570af7685523bf","_id":"grunt-update-json@0.2.1","_shasum":"8e044d0b7ccd0b7e0ea250f426331536b3a2b424","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}],"dist":{"shasum":"8e044d0b7ccd0b7e0ea250f426331536b3a2b424","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.2.1.tgz","integrity":"sha512-hfdx4yG5nGECIYysFYYiteuIsto0loJs3gfUf/O451r+EpeGr9c2yfaL4M8D5xY7ybRo8ypuMGgBYjUQxRaqdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR4+isTMutJHCPMAkTKvI9+1kYSBOk6M0e8Mq9Gv5WswIgXE0mjE/4G07QjoiFg2bVf0FfnF1TU3/BVxE0bVZdtyc="}]}},"0.2.2":{"name":"grunt-update-json","description":"Merge parts from one or more JSON files together. I use `grunt-update-json` to keep my `Bower.json` and `component.json` in sync with `package.json`.","version":"0.2.2","homepage":"https://github.com/andreaspizsa/grunt-update-json","author":{"name":"Andreas Pizsa","url":"http://github.com/AndreasPizsa"},"contributors":[{"name":"bollwyvl","url":"https://github.com/bollwyvl"},{"name":"Vasyl Zuzyak","url":"https://github.com/ZuBB"},{"name":"Andrew Dryga","url":"https://github.com/AndrewDryga"}],"repository":{"type":"git","url":"git://github.com/AndreasPizsa/grunt-update-json.git"},"bugs":{"url":"https://github.com/AndreasPizsa/grunt-update-json/issues"},"license":"MIT","main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"blanket":"~1.1.6","chai":"~1.9.1","grunt":"~0.4.2","grunt-contrib-clean":"~0.4.0","grunt-contrib-copy":"~0.5.0","grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.6.1","grunt-mocha-cov":"~0.2.1","load-grunt-tasks":"~0.4.0","mocha-term-cov-reporter":"~0.2.0","should":"~3.3.1"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","json","json pointer","merge","update","sync","bower.json","component.json","composer.json"],"dependencies":{"JSONPath":"~0.10.0","json-pointer":"~0.1.0","json-stable-stringify":"^1.0.0","lodash":"~2.4.1"},"config":{"blanket":{"pattern":["grunt-update-json/tasks"]}},"gitHead":"9d58d2e761055137b6446b94093cb0e59fa0d78e","_id":"grunt-update-json@0.2.2","_shasum":"18933db618fa03a9e82289568fc27c4ece705bc3","_from":".","_npmVersion":"3.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"andreaspizsa","email":"hopster@gmail.com"},"dist":{"shasum":"18933db618fa03a9e82289568fc27c4ece705bc3","tarball":"https://registry.npmjs.org/grunt-update-json/-/grunt-update-json-0.2.2.tgz","integrity":"sha512-vdZUc83MdzprchDjBBroKLR6LOdmGiSLYXgk92IvBK+QuAM0KAthvzHvaZ2LAdzmRZN9C+kwmDx0lZYmC9LjfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGhYQwTRayVP1CTDcaQiUtz8q/XQYxbh8Z6+OkMGfXNgIgU960NJ3t9BTA31xIQmd+Fjpq3nby2AiMJ1b+fJ3hmDg="}]},"maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}]}},"readme":"# grunt-update-json [![Travis Build Status](http://img.shields.io/travis/AndreasPizsa/grunt-update-json.svg?style=flat-square)](http://travis-ci.org/AndreasPizsa/grunt-update-json) ![npm Release](http://img.shields.io/npm/v/grunt-update-json.svg?style=flat-square \"npm Release\") ![npm License](http://img.shields.io/npm/l/grunt-update-json.svg?style=flat-square \"npm License\")\n\nMerge parts from one or more JSON files together. I use `grunt-update-json` to keep my `bower.json` and `component.json` in sync with `package.json`.\n\n\n[![Endorse on Coderwall](http://api.coderwall.com/andreaspizsa/endorsecount.png)](http://coderwall.com/andreaspizsa)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\n## Upgrading from 1.x\nThe semantics of [Object Groupings](#object-grouping) have been reversed:\n\n- was `{from: \"to\"}`\n- now``{to: \"from\"}`\n\n\n## Getting Started\n\n```shell\nnpm install grunt-update-json --save-dev\n```\n\n\nI highly favor using the fabulous [`load-grunt-tasks`](https://github.com/sindresorhus/load-grunt-tasks) over the tiring and cumbersome `grunt.loadNpmTasks`. Your grunt tasks are all in your `package.json`, so let's embrace [DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself):\n\n```shell\nnpm install load-grunt-tasks --save-dev\n```\n\n```js\n// Gruntfile.js\nmodule.exports = function (grunt) {\n    require('load-grunt-tasks')(grunt); // load all grunt tasks. Done!\n```\n\n## Using the `update_json` task\nIn your awesome project's Gruntfile, add a section named `update_json`:\n\n```js\n// Gruntfile.js\ngrunt.initConfig({\n  update_json: {\n    // set some task-level options\n    options: {\n      src: 'package.json',\n      indent: '\\t'\n    },\n    // update bower.json with data from package.json\n    bower: {\n      src: 'package.json',    // where to read from\n      dest: 'bower.json',     // where to write to\n      // the fields to update, as a String Grouping\n      fields: 'name version description repository'\n    },\n    // update component.json with data from package.json\n    // component.json fields are a named a bit differently from\n    // package.json, so let's tell update_json how to map names\n    component: {\n      // reuse the task-level `src`\n      dest: 'component.json',      // where to write to\n      fields: {                    // the fields to update\n        // notice how this time we're passing a hash instead\n        // of an array; this allows us to map the field names.\n        // We still specify all the names we want, and additionally\n        // we also specify the target name in the detination file.\n        // to            from\n        // -----------   -------------------\n        'name'            : null,         // null means 'leave as is'\n        'description'     : 'description',// but feel free to type the field name twice\n        'repository'      : 'repo',       // rename 'repository' to 'repo'\n        'version'         : null,\n        'keywords'        : null,\n        'main'            : null,\n        'dependencies'    : null,\n        'development'     : 'devDependencies',\n        'license'         : null,\n      }\n    },\n    // `composer` has the same data as `package`, but has some tricky\n    // semantics\n    composer: {\n      // again, reuse the task-level `src`\n      dest: 'composer.json',\n      // the fields in an Array Grouping with some embedded Object Groupings\n      fields: [\n        {\n          name: function(src){\n            return src.repository.url.match(/([^\\/]+\\/[^\\/]+).git/)[1];\n          }\n        },\n        'description',\n        'keywords',\n        'homepage',\n        {\n          license: 'licenses/0/type',\n          authors: [{\n            name: 'author/name',\n            homepage: 'author/url'\n          }]\n        }\n      ]\n    }\n  }\n});\n```\n\n## API\n### `options`\nLike most Grunt tasks, options can be specified at the `update_json` level\nand/or at the `update_json:<target>` level. Target-level `options` override task-level `options`.\n\n#### `options.indent`\nBy default, output will not be pretty-printed. Specify a value here to have\nindentation applied:\n```js\nupdate_json: {options: {indent: \"\\t\"}}\n```\nor for spaces:\n```js\nupdate_json: {options: {indent: \"  \"}}\n```\n\n### Source Data\n> `src`\n>\n> An input JSON file. May be a list, which will be [`_.merge`d][_merge] together.\n[_merge]: http://lodash.com/docs#merge\n### Destination Data\n> `dest`\n>\n> An output JSON file.\n\n### Field Groupings\n> `fields`\n>\n> an ordered collection of [_field specifications_](#field-specifications), which\n> can optionally contain additional lists of fields.\n\n\n#### Object Grouping\n> `{fields: {field: null, another: \"yetanother\"}}`\n>\n> A list of field specs, pointing at any other kind of field specification.\n\n\n#### Array Grouping\n> `{fields: [\"field\", \"another\", \"still another > yet another\"]}`\n>\n> Create [field copies](#field-copy), or [field renames](#field-rename), of\n> each of the listed fields.\n\n\n#### String Grouping\n> `{fields: \"field, another, still another > yetanother\"}`\n>\n> Create [field copies](#field-copy), or [field renames](#field-rename), of\n> each of the listed fields.\n\nThe most concise way to copy/rename a number of fields of simple JSON documents\n\n##### Limitations\n- Can't handle fields with `,` or `>` in their names.\n- Can't handle most complex [field paths](#field-path).\n\n\n### Field Specifications\nThe canonical Object Grouping format is used here: some specifications are not\ncompatible with some Groupings.\n\n#### Field Copy\n> `{field: null}`\n>\n> Create or replace `field` in `dest` from the value of `field` in `src`.\n\n\n#### Field Rename\n> `{renamed: \"original\"}` or\n> `\"original > renamed\"` _[String Grouping](#string-grouping) only_\n>\n> Create or replace `renamed` in `dest` with the value of `original` from `src`.\n\n\n#### Field Pointer\n> `{field: \"/some/deep/field\"}`\n>\n> Create or replace `field` in `dest` from `some/deep/field` in `src`.\n\nA field spec destination which starts with `/` will be interepreted as a\n[json-pointer](https://github.com/manuelstofer/json-pointer).\n\nTo select a field that begins with a literal `/`, escape with a single `\\`\n(written `\\\\`):\n\n`{field: \"\\\\/a\"}`\n\n\n### Field Path\n> `{field: \"$.some.path[(@.with='filters')]\"}`\n>\n>  Create or replace `field` in `dest` with the value of nodes found with a\n> JSONPath query\n\nA field spec destination which starts with `$.` will be interpreted as a\n[JSONPath](https://github.com/s3u/JSONPath) selector.\n\nTo select a field that begins with a literal `$.`, escape with a single `\\`\n(written `\\\\`):\n\n`{field: \"\\\\$.a\"}`\n\n\n#### Field Collapse\n> `{field: [\"first\", \"second\"]}`\n>\n> Create or replace an array named `field` in `dest` with the values of `first`\n> and `second` from `src`.\n\n\n#### Field Construct\n> `{field: {first: \"first\", second: \"second\"}}`\n>\n> Create or merge an object `field` in `dest` with labeled `first` and\n> `second` with their respective values from `src`\n\n\n#### Field Function\n> `{field: function(src){ return src.field; }}`\n>\n> Create a field named `field` that is the output of running a function against\n> `src`.\n\nIf all else fails, you can supply a function which will called with a copy of\nthe combined source object.\n```js\nupdate_json: {\n  composer: {\n    src: \"package.json\",\n    dest: \"composer.json\",\n    fields: {\n      name: function(src){\n        // pull username/repo off a github url\n        return src.repository.url.match(/([^\\/]+\\/[^\\/]+).git/)[1];\n      }\n    }\n  }\n}\n```\n\n## Ideas for improvement\n- see [enhancements](https://github.com/AndreasPizsa/grunt-update-json/issues?labels=enhancement&page=1&state=open)\n\n## License\n\nMIT\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/AndreasPizsa/grunt-update-json/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n","maintainers":[{"name":"andreaspizsa","email":"hopster@gmail.com"}],"time":{"modified":"2022-06-18T16:13:39.378Z","created":"2013-12-28T01:21:39.237Z","0.1.0":"2013-12-28T01:21:40.500Z","0.1.1":"2013-12-28T01:34:57.892Z","0.1.2":"2013-12-28T01:36:28.377Z","0.1.3":"2013-12-28T01:38:05.889Z","0.2.0":"2014-10-10T10:10:41.987Z","0.2.1":"2014-10-30T21:42:10.356Z","0.2.2":"2015-12-30T20:44:40.408Z"},"repository":{"type":"git","url":"git://github.com/AndreasPizsa/grunt-update-json.git"},"users":{"developit":true,"ugarz":true,"nano":true,"pfefferle":true},"homepage":"https://github.com/andreaspizsa/grunt-update-json","keywords":["gruntplugin","json","json pointer","merge","update","sync","bower.json","component.json","composer.json"],"bugs":{"url":"https://github.com/AndreasPizsa/grunt-update-json/issues"},"readmeFilename":"README.md","contributors":[{"name":"bollwyvl","url":"https://github.com/bollwyvl"},{"name":"Vasyl Zuzyak","url":"https://github.com/ZuBB"},{"name":"Andrew Dryga","url":"https://github.com/AndrewDryga"}],"author":{"name":"Andreas Pizsa","url":"http://github.com/AndreasPizsa"},"license":"MIT"}