readFilePromise.js 382 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = function (inputFileSystem, path) {
  6. return new Promise(function (resolve, reject) {
  7. inputFileSystem.readFile(path, function (err, stats) {
  8. if (err) {
  9. return reject(err);
  10. }
  11. return resolve(stats);
  12. });
  13. });
  14. };