extend-json.js 291 B

12345678910
  1. 'use strict';
  2. var extend = require('deep-extend');
  3. module.exports = function (filepath, contents, replacer, space) {
  4. var originalContent = this.readJSON(filepath, {});
  5. var newContent = extend({}, originalContent, contents);
  6. this.writeJSON(filepath, newContent, replacer, space);
  7. };