How to use vinyl-contents-tostring - 1 common examples

To help you get started, we’ve selected a few vinyl-contents-tostring 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 perrin4869 / gulp-xml-transformer / src / index.js View on Github external
return through.obj(function (file, enc, cb) {
    if (!file.isNull()) {
      return vinylToString(file, enc)
        .then((xml) => transformer(transformations, parseXmlString(xml), nsUri))
        .then((transformedXml) => {
          const contents = getContents(file, transformedXml);

          Object.assign(file, { contents });
          this.push(file);

          cb();
        })
        .catch(cb);
    }

    this.push(file);
    return cb();
  });
}

vinyl-contents-tostring

Convert vinyl file content to string

MIT
Latest version published 8 months ago

Package Health Score

66 / 100
Full package analysis

Popular vinyl-contents-tostring functions