Skip to content

Commit 4a471af

Browse files
committed
Require Node.js 10
1 parent d4681a4 commit 4a471af

File tree

5 files changed

+24
-36
lines changed

5 files changed

+24
-36
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ language: node_js
66
node_js:
77
- '12'
88
- '10'
9-
- '8'

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ declare namespace globby {
2525
extensions: ['png']
2626
}
2727
});
28+
2829
console.log(paths);
2930
//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
3031
})();

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
{
22
"name": "globby",
33
"version": "10.0.2",
4-
"description": "Extends `glob` with support for multiple patterns and exposes a Promise API",
4+
"description": "User-friendly glob matching",
55
"license": "MIT",
66
"repository": "sindresorhus/globby",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"email": "[email protected]",
910
"name": "Sindre Sorhus",
1011
"url": "sindresorhus.com"
1112
},
1213
"engines": {
13-
"node": ">=8"
14+
"node": ">=10"
1415
},
1516
"scripts": {
1617
"bench": "npm update glob-stream fast-glob && matcha bench.js",
1718
"test": "xo && ava && tsd"
1819
},
1920
"files": [
2021
"index.js",
21-
"gitignore.js",
2222
"index.d.ts",
23+
"gitignore.js",
2324
"stream-utils.js"
2425
],
2526
"keywords": [
@@ -58,9 +59,9 @@
5859
"dependencies": {
5960
"array-union": "^2.1.0",
6061
"dir-glob": "^3.0.1",
61-
"fast-glob": "^3.1.0",
62-
"ignore": "^5.1.1",
63-
"merge2": "^1.2.3",
62+
"fast-glob": "^3.1.1",
63+
"ignore": "^5.1.4",
64+
"merge2": "^1.3.0",
6465
"slash": "^3.0.0"
6566
},
6667
"devDependencies": {
@@ -69,9 +70,9 @@
6970
"glob-stream": "^6.1.0",
7071
"globby": "sindresorhus/globby#master",
7172
"matcha": "^0.7.0",
72-
"rimraf": "^2.6.3",
73-
"tsd": "^0.7.3",
74-
"xo": "^0.24.0"
73+
"rimraf": "^3.0.0",
74+
"tsd": "^0.11.0",
75+
"xo": "^0.25.3"
7576
},
7677
"xo": {
7778
"ignores": [

readme.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22

33
> User-friendly glob matching
44
5-
Based on [`fast-glob`](https://github.com/mrmlnc/fast-glob), but adds a bunch of useful features and a nicer API.
6-
5+
Based on [`fast-glob`](https://github.com/mrmlnc/fast-glob) but adds a bunch of useful features.
76

87
## Features
98

109
- Promise API
1110
- Multiple patterns
1211
- Negated patterns: `['foo*', '!foobar']`
13-
- Expands directories: `dir``dir/**/*`
12+
- Expands directories: `foo``foo/**/*`
1413
- Supports `.gitignore`
1514

16-
1715
## Install
1816

1917
```
2018
$ npm install globby
2119
```
2220

23-
2421
## Usage
2522

2623
```
@@ -40,7 +37,6 @@ const globby = require('globby');
4037
})();
4138
```
4239

43-
4440
## API
4541

4642
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@@ -63,7 +59,7 @@ See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in
6359

6460
##### expandDirectories
6561

66-
Type: `boolean | string[] | object`<br>
62+
Type: `boolean | string[] | object`\
6763
Default: `true`
6864

6965
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below:
@@ -88,7 +84,7 @@ Note that if you set this option to `false`, you won't get back matched director
8884

8985
##### gitignore
9086

91-
Type: `boolean`<br>
87+
Type: `boolean`\
9288
Default: `false`
9389

9490
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
@@ -131,8 +127,7 @@ This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isd
131127

132128
Returns a `Promise<(path: string) => boolean>` indicating whether a given path is ignored via a `.gitignore` file.
133129

134-
Takes `cwd?: string` and `ignore?: string[]` as options. `.gitignore` files matched by the ignore config are not
135-
used for the resulting filter function.
130+
Takes `cwd?: string` and `ignore?: string[]` as options. `.gitignore` files matched by the ignore config are not used for the resulting filter function.
136131

137132
```js
138133
const {gitignore} = require('globby');
@@ -149,7 +144,6 @@ Returns a `(path: string) => boolean` indicating whether a given path is ignored
149144

150145
Takes the same options as `globby.gitignore`.
151146

152-
153147
## Globbing patterns
154148

155149
Just a quick overview.
@@ -162,14 +156,12 @@ Just a quick overview.
162156

163157
[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
164158

165-
166159
## globby for enterprise
167160

168161
Available as part of the Tidelift Subscription.
169162

170163
The maintainers of globby and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-globby?utm_source=npm-globby&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
171164

172-
173165
## Related
174166

175167
- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem

test.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import globby from '.';
77

88
const cwd = process.cwd();
99
const tmp = 'tmp';
10+
1011
const fixture = [
1112
'a.tmp',
1213
'b.tmp',
@@ -77,20 +78,14 @@ test('glob - stream', async t => {
7778
t.deepEqual((await getStream.array(globby.stream('*.tmp'))).sort(), ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']);
7879
});
7980

80-
// Readable streams are iterable since Node.js 10, but this test runs on 6 and 8 too.
81-
// So we define the test only if async iteration is supported.
82-
if (Symbol.asyncIterator) {
83-
// For the reason behind `eslint-disable` below see https://github.com/avajs/eslint-plugin-ava/issues/216
84-
// eslint-disable-next-line ava/no-async-fn-without-await
85-
test('glob - stream async iterator support', async t => {
86-
const results = [];
87-
for await (const path of globby.stream('*.tmp')) {
88-
results.push(path);
89-
}
81+
test('glob - stream async iterator support', async t => {
82+
const results = [];
83+
for await (const path of globby.stream('*.tmp')) {
84+
results.push(path);
85+
}
9086

91-
t.deepEqual(results, ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']);
92-
});
93-
}
87+
t.deepEqual(results, ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']);
88+
});
9489

9590
test('glob - stream - multiple file paths', async t => {
9691
t.deepEqual(await getStream.array(globby.stream(['a.tmp', 'b.tmp'])), ['a.tmp', 'b.tmp']);

0 commit comments

Comments
 (0)