How to use the readFileAsync function from fs

Find comprehensive JavaScript fs.readFileAsync code examples handpicked from public code repositorys.

70
71
72
73
74
75
76
77
78
79
  };
}

function readSourceFileAsync(source, options) {
  options = options || {cwd: '.'};
  return fs.readFileAsync(path.join(options.cwd, source))
  .catch(function(err) {
    throw err;
  });
}
fork icon3
star icon12
watch icon3

+ 3 other calls in file

301
302
303
304
305
306
307
308
309
310
311
    instrumented: path.join(root, "js", "instrumented"),
    coverage: path.join(root, "coverage")
};


function build(options) {
    var npmPackage = fs.readFileAsync("./package.json").then(JSON.parse);
    var sourceFileNames = getSourcePaths(options.features);
    var license = utils.getLicense();
    var mainDir = ensureDirectory(dirs.main, options.main);
    var debugDir = ensureDirectory(dirs.debug, options.debug);
fork icon0
star icon0
watch icon1

+ 23 other calls in file

141
142
143
144
145
146
147
148
149
150
function replaceJsLibraryMappings() {
  return Promise
    .try(() => {
      return fs.readFileAsync(jsLibraryMappingsXmlPath)
        .catch(function (e) {
          return fs.readFileAsync(jsLibraryMappingsXmlLocalDataPath);
        });
    })
    .then(function (buffer) {
      var data = buffer.toString();
fork icon0
star icon0
watch icon0

+ 7 other calls in file