lib/kju.js
function read(file, index, files) {
    fs.readFile(self.path + file, function readFile(err, contents) {
      if (err) return done(), self.emit('error', err);

      // try to parse the file as JSON, if that doesn't work we have big issue
      // because the file is damaged.
      try {
        var todo = JSON.parse(contents.toString('utf8'));

        // pfew, it worked re-add it to kju and remove the file, I don't really
        // care about the clean up process. So I'm not gonna handle the errors
        // that could occur there.
        self.push.apply(self, todo);
        fs.unlink(self.path + file, function ignore(err) {});
      } catch (e) {
        self.emit('error'
          , new Error('Corrupted file, unable to parse contents of ' + file)
        );
      }

      done();
    });
  }
function read(file, index, files) {
    fs.readFile(self.path + file, function readFile(err, contents) {
      if (err) return done(), self.emit('error', err);

      // try to parse the file as JSON, if that doesn't work we have big issue
      // because the file is damaged.
      try {
        var todo = JSON.parse(contents.toString('utf8'));

        // pfew, it worked re-add it to kju and remove the file, I don't really
        // care about the clean up process. So I'm not gonna handle the errors
        // that could occur there.
        self.push.apply(self, todo);
        fs.unlink(self.path + file, function ignore(err) {});
      } catch (e) {
        self.emit('error'
          , new Error('Corrupted file, unable to parse contents of ' + file)
        );
      }

      done();
    });
  }
Read file and process it.

@param {String} file
@param {Number} index
@param {Array} files
@api private