How to use vinyl-fs - 10 common examples

To help you get started, we’ve selected a few vinyl-fs 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 ngryman / gulp-bro / test / task.js View on Github external
test.cb('bundle an empty file', t => {
  vfs
    .src('test/fixtures/empty.js')
    .pipe(bro())
    .pipe(assert.length(1))
    .pipe(
      assert.first(d =>
        t.true(d.contents.toString().length > 0 /* browserify runtime */)
      )
    )
    .pipe(assert.end(t.end))
})
github palerdot / hotcold / gulpfile.js View on Github external
function zip_crx_files (mode, async_cb) {

    console.log("zipping ", mode);

    var src = "./releases/chrome-app/" + mode + "/**",
        zip_file_name = mode + ".zip";

    vfs.src( src )
        // zip the folder
        .pipe( zip(zip_file_name) )
        .pipe( vfs.dest( "./releases/chrome-app/" ) )
        .on( "end", async_cb );

}
github Fitbit / fitbit-sdk-toolchain / src / index.ts View on Github external
// there should not be any opportunity for glitches as only
              // one vinylFS stream is active at a time. Wrapping the
              // vinylFS stream in a playbackStream would be safer, but
              // would buffer all the resources into memory at once with
              // no backpressure. We like our users and don't want to eat
              // all their RAM, so we just have to be careful not to
              // introduce a regression when modifying this code.
              vinylFS.src('./resources/**', { base: '.' }),
              buildDeviceResources(
                projectConfig,
                buildTargets[family],
                onDiagnostic,
              ),
            ),
            new pumpify.obj(
              vinylFS.src(componentTargets.device.translationsGlob, {
                base: '.',
              }),
              compileTranslations(projectConfig.defaultLanguage),
            ),
          ),
          makeDeviceManifest({ projectConfig, buildId }),
          zip(bundleFilename),
          transformIf(
            maxDeviceBundleSize !== undefined,
            validateFileSizes({
              onDiagnostic,
              maxSizes: { [bundleFilename]: maxDeviceBundleSize },
            }),
          ),
          gulpSetProperty({
            componentBundle: {
github SassDoc / sassdoc / src / sassdoc.js View on Github external
env.logger.debug(() => {
        fs.writeFile(
          'sassdoc-data.json',
          JSON.stringify(data, null, 2) + '\n',
          err => {
            if (err) throw err
          }
        )

        return 'Dumping data to `sassdoc-data.json`.'
      })
    })

  let streams = [
    vfs.src(env.src),
    recurse(),
    exclude(env.exclude || []),
    converter({ from: 'sass', to: 'scss' }),
    filter
  ]

  let pipeline = () => {
    return new Promise((resolve, reject) => {
      pipe(...streams, err =>
        err ? reject(err) : resolve())
      .resume() // Drain.
    })
  }

  try {
    await pipeline()
github o2team / athena / lib / build / athena_mate / athena_concat_server.js View on Github external
function concactStatic (modulePath, config, cb) {
  var streamArr = [];
  var staticPath = require(path.join(modulePath, 'static-conf')).staticPath;
  if (_.isEmpty(staticPath)) {
    cb();
    return;
  }
  for (var key in staticPath) {
    // css
    if (path.extname(key).indexOf('css') >= 0) {
      streamArr.push(vinylFs
        .src(staticPath[key].map(function (item) {
          return path.join(modulePath, config.dest, '_', item);
        }))
        .pipe(concatCore(key))
        .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'static', 'css'))));
    }

    // js
    if (path.extname(key).indexOf('js') >= 0) {
      streamArr.push(vinylFs
        .src(staticPath[key].map(function (item) {
          return path.join(modulePath, config.dest, '_', item);
        }))
        .pipe(concatCore(key))
        .pipe(vinylFs.dest(path.join(modulePath, config.dest, '_static', 'static', 'js'))));
    }
  }
  es.merge(streamArr).on('end', function () {
    cb();
  });
}
github router5 / router5 / scripts / changelog.js View on Github external
function conventionalChangelog(done) {
    clog({
            preset: 'angular',
            // repository: 'https://github.com/router5/router5',
            // append: false
        })
        .pipe(source('CHANGELOG.md'))
        .pipe(fs.dest(path.join(__dirname, '..')));
}
github assemble / assemble / lib / extensions / vinyl-fs.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
    if (typeof options === 'function' || Array.isArray(options)) {
      fn = options;
      options = null;
    }

    // Tasks to watch
    if (Array.isArray(fn)) {
      return fs.watch(glob, options, function() {
        this.start.apply(this, fn);
      }.bind(this));
    }
    return fs.watch(glob, options, fn);
  };
github legomushroom / resize / node_modules / gulp / index.js View on Github external
Gulp.prototype.watch = function (glob, opt, fn) {
  if (typeof opt === 'function' || Array.isArray(opt)) {
    fn = opt;
    opt = null;
  }

  // array of tasks given
  if (Array.isArray(fn)) {
    return vfs.watch(glob, opt, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }

  return vfs.watch(glob, opt, fn);
};
github jonschlinkert / extract-comments / fixtures / assemble.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
  if (typeof options === 'function' || Array.isArray(options)) {
    fn = options;
    options = null;
  }

  // Tasks to watch
  if (Array.isArray(fn)) {
    return fs.watch(glob, options, function() {
      this.start.apply(this, fn);
    }.bind(this));
  }
  return fs.watch(glob, options, fn);
};
github assemble / assemble / lib / extensions / vinyl-fs.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
    if (typeof options === 'function' || Array.isArray(options)) {
      fn = options;
      options = null;
    }

    // Tasks to watch
    if (Array.isArray(fn)) {
      return fs.watch(glob, options, function() {
        this.start.apply(this, fn);
      }.bind(this));
    }
    return fs.watch(glob, options, fn);
  };

vinyl-fs

Vinyl adapter for the file system.

MIT
Latest version published 5 years ago

Package Health Score

68 / 100
Full package analysis