source: trip-planner-front/node_modules/dir-glob/readme.md@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1# dir-glob [![Build Status](https://travis-ci.org/kevva/dir-glob.svg?branch=master)](https://travis-ci.org/kevva/dir-glob)
2
3> Convert directories to glob compatible strings
4
5
6## Install
7
8```
9$ npm install dir-glob
10```
11
12
13## Usage
14
15```js
16const dirGlob = require('dir-glob');
17
18(async () => {
19 console.log(await dirGlob(['index.js', 'test.js', 'fixtures']));
20 //=> ['index.js', 'test.js', 'fixtures/**']
21
22 console.log(await dirGlob(['index.js', 'inner_folder'], {cwd: 'fixtures'}));
23 //=> ['index.js', 'inner_folder/**']
24
25 console.log(await dirGlob(['lib/**', 'fixtures'], {
26 files: ['test', 'unicorn']
27 extensions: ['js']
28 }));
29 //=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
30
31 console.log(await dirGlob(['lib/**', 'fixtures'], {
32 files: ['test', 'unicorn', '*.jsx'],
33 extensions: ['js', 'png']
34 }));
35 //=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
36})();
37```
38
39
40## API
41
42### dirGlob(input, options?)
43
44Returns a `Promise<string[]>` with globs.
45
46### dirGlob.sync(input, options?)
47
48Returns a `string[]` with globs.
49
50#### input
51
52Type: `string | string[]`
53
54Paths.
55
56#### options
57
58Type: `object`
59
60##### extensions
61
62Type: `string[]`
63
64Append extensions to the end of your globs.
65
66##### files
67
68Type: `string[]`
69
70Only glob for certain files.
71
72##### cwd
73
74Type: `string[]`
75
76Test in specific directory.
Note: See TracBrowser for help on using the repository browser.