Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gulpjs/glob-stream
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8210a3c95cabc032088b1a0ff47ccbeb2f83ec52
Choose a base ref
...
head repository: gulpjs/glob-stream
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d8eace309c58b2097b60c926bd68c98a58451809
Choose a head ref
  • 16 commits
  • 22 files changed
  • 7 contributors

Commits on Oct 31, 2021

  1. Copy the full SHA
    8dd405f View commit details
  2. Copy the full SHA
    4e6984d View commit details
  3. chore: Tidelift tasks

    sttk authored and phated committed Oct 31, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    95fdea5 View commit details
  4. chore!: Normalize repository, dropping node <10.13 support (#101)

    Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com>
    coreyfarrell and phated committed Oct 31, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    targos Michaël Zasso
    Copy the full SHA
    c110ed1 View commit details
  5. chore: Run prettier

    phated committed Oct 31, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    daa4182 View commit details
  6. chore: Remove some old cruft

    phated committed Oct 31, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    bd9216e View commit details
  7. chore: Release 7.0.0 (#109)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Oct 31, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    37cc385 View commit details

Commits on Nov 16, 2022

  1. Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    156f801 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    f37bccc View commit details

Commits on Nov 18, 2022

  1. fix: Properly handle glob-like characters in paths (#117)

    chore: Add tests for paths with square brackets
    chore: Upgrade to-absolute-glob to properly escape glob-like characters in paths
    chore: Update glob to properly support escaped glob-like characters
    
    Co-authored-by: PWall <34860495+PWall2222@users.noreply.github.com>
    phated and pwall2222 authored Nov 18, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    872a957 View commit details

Commits on Jan 3, 2023

  1. feat!: Replace glob with anymatch & custom directory walk (#118)

    feat!: Combine GlobStream & GlobReadable into unified API
    phated authored Jan 3, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    6aad264 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    BethGriggs Bethany Griggs
    Copy the full SHA
    ef7f1d3 View commit details
  3. chore: Update CI badge

    phated committed Jan 3, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    codebytere Shelley Vohr
    Copy the full SHA
    c92aa14 View commit details
  4. Verified

    This commit was signed with the committer’s verified signature.
    codebytere Shelley Vohr
    Copy the full SHA
    5097aed View commit details

Commits on Apr 23, 2023

  1. feat!: Switch to streamx (#119)

    chore: Ensure project works with different streams
    chore: Add tests showing globbing of many files
    chore: Longer timeout for windows tests
    chore: Update docs to mention streamx
    fix: Resolve cwd to support relative cwd paths
    fix: Normalize cwd on windows
    phated authored Apr 23, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    codebytere Shelley Vohr
    Copy the full SHA
    8d6b35c View commit details
  2. chore: Release 8.0.0 (#116)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Apr 23, 2023
    Copy the full SHA
    d8eace3 View commit details
Showing with 1,453 additions and 1,168 deletions.
  1. +1 −0 .editorconfig
  2. +1 −0 .gitattributes
  3. +75 −0 .github/workflows/dev.yml
  4. +16 −0 .github/workflows/release.yml
  5. +42 −4 .gitignore
  6. +0 −3 .jscsrc
  7. +1 −0 .npmrc
  8. +3 −0 .prettierignore
  9. +0 −9 .travis.yml
  10. +40 −0 CHANGELOG.md
  11. +1 −1 LICENSE
  12. +22 −50 README.md
  13. +0 −25 appveyor.yml
  14. +253 −60 index.js
  15. +30 −27 package.json
  16. +0 −117 readable.js
  17. +0 −3 test/.eslintrc
  18. 0 test/.gitkeep
  19. +1 −0 test/fixtures/has [brackets]/test.foo
  20. +1 −1 test/fixtures/whatsgoingon/test.js
  21. +966 −683 test/index.js
  22. +0 −185 test/readable.js
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
75 changes: 75 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: dev
on:
pull_request:
push:
branches:
- master
- main
env:
CI: true

jobs:
prettier:
name: Format code
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prettier
uses: gulpjs/prettier_action@v3.0
with:
commit_message: 'chore: Run prettier'
prettier_options: '--write .'

test:
name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm test

- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{matrix.os}}-node-${{ matrix.node }}
parallel: true

coveralls:
needs: test
name: Finish up

runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release
on:
push:
branches:
- master
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: release-please-action
46 changes: 42 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,67 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Garbage files
.DS_Store

# Test results
test.xunit
3 changes: 0 additions & 3 deletions .jscsrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage/
.nyc_output/
CHANGELOG.md
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

## [8.0.0](https://www.github.com/gulpjs/glob-stream/compare/v7.0.0...v8.0.0) (2023-04-23)


### ⚠ BREAKING CHANGES

* Switch to streamx (#119)
* Combine GlobStream & GlobReadable into unified API
* Replace glob with anymatch & custom directory walk (#118)
* Drop support for ordered globs (#115)

### Features

* Combine GlobStream & GlobReadable into unified API ([6aad264](https://www.github.com/gulpjs/glob-stream/commit/6aad264004e4f1a7f1b6e112c5d7e0fc7db72851))
* Replace glob with anymatch & custom directory walk ([#118](https://www.github.com/gulpjs/glob-stream/issues/118)) ([6aad264](https://www.github.com/gulpjs/glob-stream/commit/6aad264004e4f1a7f1b6e112c5d7e0fc7db72851))
* Switch to streamx ([#119](https://www.github.com/gulpjs/glob-stream/issues/119)) ([8d6b35c](https://www.github.com/gulpjs/glob-stream/commit/8d6b35c1f0c89b7869d2ed7ab9e5ec79694e28e2))


### Bug Fixes

* Normalize cwd on windows ([8d6b35c](https://www.github.com/gulpjs/glob-stream/commit/8d6b35c1f0c89b7869d2ed7ab9e5ec79694e28e2))
* Properly handle glob-like characters in paths ([#117](https://www.github.com/gulpjs/glob-stream/issues/117)) ([872a957](https://www.github.com/gulpjs/glob-stream/commit/872a957c59cc4d1a1bc674b0370c97809d7c595c))
* Resolve cwd to support relative cwd paths ([8d6b35c](https://www.github.com/gulpjs/glob-stream/commit/8d6b35c1f0c89b7869d2ed7ab9e5ec79694e28e2))


### Miscellaneous Chores

* Drop support for ordered globs ([#115](https://www.github.com/gulpjs/glob-stream/issues/115)) ([f37bccc](https://www.github.com/gulpjs/glob-stream/commit/f37bccc91cd7ffe5bd61010e10b3a850c134677a))

## [7.0.0](https://www.github.com/gulpjs/glob-stream/compare/v6.1.0...v7.0.0) (2021-10-31)


### ⚠ BREAKING CHANGES

* Normalize repository, dropping node <10.13 support (#101)

### Miscellaneous Chores

* Normalize repository, dropping node <10.13 support ([#101](https://www.github.com/gulpjs/glob-stream/issues/101)) ([c110ed1](https://www.github.com/gulpjs/glob-stream/commit/c110ed1602b9bbcb380c97298e9ba41a29a0be40))
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
Copyright (c) 2015-2021 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
72 changes: 22 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,27 +6,30 @@

# glob-stream

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

A [Readable Stream][readable-stream-url] interface over [node-glob][node-glob-url].
[Readable streamx][streamx-url] interface over [anymatch][anymatch-url].

## Usage

```javascript
```js
var gs = require('glob-stream');

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

var writable = /* your WriteableStream */
var writable =
/* your WriteableStream */

readable.pipe(writable);
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`][allow-empty-url]).
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`][allow-empty-url]).

## API

### `globStream(globs, options)`
### `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.

@@ -48,14 +51,6 @@ Type: `Boolean`

Default: `false`

##### `options.silent`

Whether or not to suppress warnings on stderr from [node-glob][node-glob-url]. This is passed through to [node-glob][node-glob-url].

Type: `Boolean`

Default: `true`

##### `options.cwd`

The current working directory that the glob is resolved against.
@@ -68,8 +63,6 @@ Default: `process.cwd()`

The root path that the glob is resolved against.

__Note: This is never passed to [node-glob][node-glob-url] because it is pre-resolved against your paths.__

Type: `String`

Default: `undefined` (use the filesystem root)
@@ -100,47 +93,26 @@ Default: `'path'`

##### other

Any glob-related options are documented in [node-glob][node-glob-url]. Those options are forwarded verbatim, with the exception of `root` and `ignore`. `root` is pre-resolved and `ignore` is joined with all negative globs.

#### Globbing & Negation

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

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

The following would __not__ exclude any files:
```js
gs(['!b*.js', '*.js'])
```

However, this would exclude all files that started with `b`:
```js
gs(['*.js', '!b*.js'])
```
Any glob-related options are documented in [picomatch][picomatch-options-url].

## License

MIT

[node-glob-url]: https://github.com/isaacs/node-glob
<!-- prettier-ignore-start -->
[anymatch-url]: https://github.com/micromatch/anymatch
[picomatch-options-url]: https://github.com/micromatch/picomatch#options
[glob-parent-url]: https://github.com/es128/glob-parent
[allow-empty-url]: #optionsallowempty
[readable-stream-url]: https://nodejs.org/api/stream.html#stream_readable_streams
[streamx-url]: https://github.com/streamxorg/streamx#readable-stream

[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg
[downloads-image]: https://img.shields.io/npm/dm/glob-stream.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/glob-stream
[npm-image]: http://img.shields.io/npm/v/glob-stream.svg
[npm-image]: https://img.shields.io/npm/v/glob-stream.svg?style=flat-square

[travis-url]: https://travis-ci.org/gulpjs/glob-stream
[travis-image]: http://img.shields.io/travis/gulpjs/glob-stream.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-stream
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-stream.svg?label=appveyor
[ci-url]: https://github.com/gulpjs/glob-stream/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/glob-stream/dev.yml?style=flat-square

[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-stream.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-stream/master.svg?style=flat-square
<!-- prettier-ignore-end -->
25 changes: 0 additions & 25 deletions appveyor.yml

This file was deleted.

Loading