How to use the write.stream function in write

To help you get started, we’ve selected a few write examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github boilerplates / scaffold / lib / metadata / resolvers / github.js View on Github external
utils.async.map(res, function (config, next) {
        if (dest) {
          config.contents
            .pipe(writeFile.stream(config.dest))
            .on('error', next)
            .on('finish', function () {
              next(null, config);
            });
        } else {
          config.contents
            .pipe(writeBuffer(function (err, content) {
              if (err) return next(err);
              config.content = content;
              next(null, config);
            }))
            .on('error', next);
        }
      }, function (err, results) {
        if (err) return cb(err);
github jonschlinkert / write-json / index.js View on Github external
writeJson.stream = function(filepath, options) {
  var args = [].slice.call(arguments, 1);
  return writeFile.stream(filepath, stringify.apply(null, args));
};
github boilerplates / scaffold / lib / plugins / save.js View on Github external
utils.async.each(res, function (config, next) {
          config.contents
            .pipe(writeFile.stream(config.dest))
            .on('error', next)
            .on('finish', next);
        }, function (err) {
          if (err) return cb(err);

write

Write data to a file, replacing the file if it already exists and creating any intermediate directories if they don't already exist. Thin wrapper around node's native fs methods.

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis

Popular write functions