GithubHelp home page GithubHelp logo

glob-stream's Introduction

glob-stream

NPM version Downloads Build Status Coveralls Status Gitter chat

A 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.

API

create(globs, options)

Returns a stream for multiple globs or filters.

createStream(positiveGlob, negativeGlobs, options)

Returns a stream for a single glob or filter.

Options

  • cwd
    • Default is process.cwd()
  • base
    • Default is everything before a glob starts (see glob-parent)
  • 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
  • Any through2 related options are documented in through2

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.

License

MIT

glob-stream's People

Contributors

armed avatar azweb76 avatar bitdeli-chef avatar callumacrae avatar ckross01 avatar danivek avatar es128 avatar janpot avatar jonschlinkert avatar lazd avatar pdehaan avatar phated avatar robrich avatar shinnn avatar sindresorhus avatar tomchentw avatar trysound avatar ultcombo avatar yocontra avatar

Watchers

 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.