all files / file-manager-js/lib/ readFile.js

87.5% Statements 7/8
50% Branches 1/2
100% Functions 0/0
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14               
// retrieves file content
const readFile = fsReadFile => path =>
  new Promise((resolve, reject) => {
    fsReadFile(path, (error, data) => {
      Iif (error) {
        reject(error);
      } else {
        resolve(data);
      }
    });
  });
 
module.exports = readFile;