How to use the vinyl.call function in vinyl

To help you get started, we’ve selected a few vinyl 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 gameclosure / devkit-core / src / build / resources / index.js View on Github external
function ResourceFile(directory, filename, outputDirectory, statCache) {

  if (!filename) { throw new Error("Expected a filename"); }

  this.sourcePath = path.resolve(directory.src, filename);
  this.sourceDirectory = directory.src;

  // a vinyl file records changes to the file's path -- the first path in the
  // history is the location on disk, then we set the path to the target
  // location
  File.call(this, {
    base: directory.src,
    path: this.sourcePath,
    stat: statCache && statCache[this.sourcePath]
  });

  this.sourceRelativePath = path.relative(this.sourceDirectory, this.sourcePath);
  this.targetRelativePath = slash(path.join(directory.target, this.sourceRelativePath));

  this.base = outputDirectory;
  this.path = path.join(outputDirectory, this.targetRelativePath);

  this._isStream = true;
}
github amtrack / force-dev-tool / lib / metadata-file.js View on Github external
var MetadataFile = module.exports = function(opts) {
	File.call(this, opts);
};
github jonschlinkert / templates / lib / item.js View on Github external
this.options = item.options || {};
  this.locals = item.locals || {};
  this.data = item.data || {};

  this.define('contents', {
    configurable: true,
    enumerable: false,
    set: function(val) {
      utils.syncContents(this, val);
    },
    get: function() {
      return this._contents;
    }
  });

  Vinyl.call(this, item);
  var base = this.base;
  delete item.base;

  Base.call(this, item);
  delete this.base;
  this.base = base;

  for (var key in item) {
    var val = item[key];
    if (key === 'stat' && utils.isObject(val) && val.mode) {
      this.set(key, utils.cloneStats(val));
    } else if (val) {
      this.set(key, val);
    }
  }

vinyl

Virtual file format.

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis