How to use the vinyl-fs.src function in vinyl-fs

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 Crossbow-js / crossbow-sites / test / specs / stream / stream.posts.js View on Github external
it("works with urlFormat", function(done) {

        var expected = ["shane/kittie/post1.html", "shane/kittie/post2.html"];
        var out =      [];

        fs.src([
            "test/fixtures/_posts/**"
        ])
            .pipe(crossbow.stream({
                config: {
                    base: "test/fixtures",
                    urlFormat: {
                        "type:post": "/shane/kittie/:filename"
                    }
                }
            }))
            .pipe(through.obj(function (file, enc, cb) {
                out.push(file.relative);
                cb();
            }, function (cb) {
                this.emit("end");
                cb();
github JsAaron / vue2-analysis / vue / vue-0.10.6 / tasks / instrument.js View on Github external
grunt.registerTask('instrument', function () {
        fs.src('./component.json')
            .pipe(component.scripts({
                name: 'vue.test'
            }))
            .pipe(fs.dest('./test'))
            .on('end', this.async())
    })
}
github update / update / lib / stack.js View on Github external
exports.templates = function (app, glob, opts) {
  opts = _.merge({}, app.options, opts);
  opts.cwd = app.get('updater.cwd');
  session.set('templates', opts);

  return utils.createStack(app, [
    vfs.src(glob, opts),
    plugins.init.call(app, opts)
  ]);
};
github apache / camel-website / antora-ui-camel / gulp.d / tasks / build-preview-pages.js View on Github external
function registerTemplatedHelpers (src) {
  return vfs.src('helpers/*.js.template', { base: src, cwd: src })
    .pipe(data(() => ({ manifest: fs.readFileSync('./public/_/data/rev-manifest.json').toString() })))
    .pipe(template())
    .pipe(map((file, enc, next) => {
      handlebars.registerHelper(file.stem.replace('.js', ''), requireFromString(file.contents.toString()))
      next()
    }))
}
github apache / camel-website / antora-ui-camel / gulp.d / tasks / build-preview-pages.js View on Github external
function copyImages (src, dest) {
  return vfs.src('**/*.{png,svg}', { base: src, cwd: src }).pipe(vfs.dest(dest))
}

vinyl-fs

Vinyl adapter for the file system.

MIT
Latest version published 1 year ago

Package Health Score

78 / 100
Full package analysis