code: function writeJSON(filename, obj) {
  
      return new Promise(function (resolve, reject) {
  
        if (!Object.is(obj)) resolve(new Error('writeJSON requires the second argument to be an object'));
  
        _fs2['default'].writeFile(filename, JSON.stringify(obj, null, 2) + '\n', function (err) {
          if (err) reject(err);
          resolve(obj);
        });
      });
    }
docs: write json file, return promise