'use strict';

const fs = require('fs');

function* read(file) {
  return yield new Promise((fulfill, reject) => {
    fs.readFile(file, 'utf8', (err, data) => {
      if (err) {
        reject(err);
      } else {
        fulfill(JSON.parse(data));
      }
    });
  });
}

module.exports = {
  read,
  write: (marks) =>
    JSON.stringify(marks, null, 2) + '\n'
};

@@ -12,268 +12,8 @@
 ';%0A%0A
-const fs = require('fs');%0A%0Afunction* read(file) %7B%0A  return yield new Promise((fulfill, reject) =%3E %7B%0A    fs.readFile(file, 'utf8', (err, data) =%3E %7B%0A      if (err) %7B%0A        reject(err);%0A      %7D else %7B%0A        fulfill(JSON.parse(data));%0A      %7D%0A    %7D);%0A  %7D);%0A%7D%0A%0A
 modu
@@ -31,16 +31,8 @@
 = %7B%0A
-  read,%0A
   wr

Remove #read(...) from json writer