Giter VIP home page Giter VIP logo

glob-stream's Introduction

glob-stream NPM version Build Status Coveralls Status Dependency Status

Information

Packageglob-stream
Description File system globs as a stream
Node Version >= 0.9

This is a simple wrapper around node-glob to make it streamy.

Usage

var gs = require('glob-stream');

var stream = gs.create('./files/**/*.coffee', {options});

stream.on('data', function(file){
  // file has path, base, and cwd attrs
});

You can pass any combination of globs. One caveat is that you can not only pass a glob negation, you must give it at least one positive glob so it knows where to start. All given must match for the file to be returned.

Options

  • cwd
    • Default is process.cwd()
  • base
    • Default is everything before a glob starts (see glob2base)
  • cwdbase
    • Default is false
    • When true it is the same as saying opt.base = opt.cwd
  • allowEmpty
    • Default is false
    • If true, won't emit an error when a glob pointing at a single file fails to match

This argument is passed directly to node-glob so check there for more options

Glob

var stream = gs.create(['./**/*.js', '!./node_modules/**/*']);

Globs are executed in order, so negations should follow positive globs. For example:

gulp.src(['!b*.js', '*.js'])

would not exclude any files, but this would

gulp.src(['*.js', '!b*.js'])

Related

  • globby - Non-streaming glob wrapper with support for multiple patterns.

glob-stream's People

Contributors

yocontra avatar callumacrae avatar shinnn avatar azweb76 avatar ultcombo avatar tomchentw avatar phated avatar armed avatar bitdeli-chef avatar lazd avatar robrich avatar sindresorhus avatar

Watchers

James Cloos avatar Jan Potoms avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.