glob-stream
File system globs as a stream
Last updated 11 years ago by fractal .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install glob-stream 
SYNC missed versions from official npm registry.

glob-stream

NPM version Downloads Build Status Coveralls Status

Readable streamx interface over anymatch.

Usage

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

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

var writable =
  /* your WriteableStream */

  readable.pipe(writable);

You can pass any combination of glob strings. One caveat is that you cannot only pass a negative glob, you must give it at least one positive glob so it knows where to start. If given a non-glob path (also referred to as a singular glob), only one file will be emitted. If given a singular glob and no files match, an error is emitted (see also options.allowEmpty).

API

globStream(globs, [options])

Takes a glob string or an array of glob strings as the first argument and an options object as the second. Returns a stream of objects that contain cwd, base and path properties.

Options

options.allowEmpty

Whether or not to error upon an empty singular glob.

Type: Boolean

Default: false (error upon no match)

options.dot

Whether or not to treat dotfiles as regular files. This is passed through to anymatch.

Type: Boolean

Default: false

options.cwd

The current working directory that the glob is resolved against.

Type: String

Default: process.cwd()

options.root

The root path that the glob is resolved against.

Type: String

Default: undefined (use the filesystem root)

options.base

The absolute segment of the glob path that isn't a glob. This value is attached to each glob object and is useful for relative pathing.

Type: String

Default: The absolute path segement before a glob starts (see glob-parent)

options.cwdbase

Whether or not the cwd and base should be the same.

Type: Boolean

Default: false

options.uniqueBy

Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing cwd, base, path properties) to compare against.

Type: String or Function

Default: 'path'

other

Any glob-related options are documented in picomatch.

License

MIT

Current Tags

  • 8.0.2                                ...           latest (7 months ago)

50 Versions

  • 8.0.2                                ...           7 months ago
  • 8.0.1                                ...           8 months ago
  • 8.0.0                                ...           2 years ago
  • 7.0.0                                ...           3 years ago
  • 6.1.0                                ...           8 years ago
  • 6.0.0                                ...           8 years ago
  • 5.3.5                                ...           8 years ago
  • 5.3.4                                ...           8 years ago
  • 5.3.3                                ...           8 years ago
  • 5.3.2                                ...           9 years ago
  • 5.3.1                                ...           9 years ago
  • 5.3.0                                ...           9 years ago
  • 5.2.0                                ...           9 years ago
  • 4.1.1                                ...           10 years ago
  • 5.0.0                                ...           10 years ago
  • 4.1.0                                ...           10 years ago
  • 4.0.1                                ...           10 years ago
  • 4.0.0                                ...           10 years ago
  • 3.1.18                                ...           10 years ago
  • 3.1.17                                ...           10 years ago
  • 3.1.16                                ...           10 years ago
  • 3.1.15                                ...           10 years ago
  • 3.1.14                                ...           10 years ago
  • 3.1.13                                ...           10 years ago
  • 3.1.12                                ...           10 years ago
  • 3.1.11                                ...           10 years ago
  • 3.1.10                                ...           10 years ago
  • 3.1.9                                ...           11 years ago
  • 3.1.8                                ...           11 years ago
  • 3.1.7                                ...           11 years ago
  • 3.1.6                                ...           11 years ago
  • 3.1.5                                ...           11 years ago
  • 3.1.3                                ...           11 years ago
  • 3.1.2                                ...           11 years ago
  • 3.1.1                                ...           11 years ago
  • 3.1.0                                ...           11 years ago
  • 3.0.5                                ...           11 years ago
  • 3.0.4                                ...           11 years ago
  • 3.0.3                                ...           11 years ago
  • 3.0.2                                ...           11 years ago
  • 3.0.1                                ...           11 years ago
  • 3.0.0                                ...           11 years ago
  • 2.0.1                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (2)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE