minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / dir-glob / readme.md
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
16 const dirGlob = require('dir-glob');
17
18 dirGlob(['index.js', 'test.js', 'fixtures']).then(files => {
19         console.log(files);
20         //=> ['index.js', 'test.js', 'fixtures/**']
21 });
22
23 dirGlob(['index.js', 'inner_folder'], {
24         cwd: 'fixtures'
25 }).then(files => {
26         console.log(files);
27         //=> ['index.js', 'inner_folder/**']
28 });
29
30 dirGlob(['lib/**', 'fixtures'], {
31         files: ['test', 'unicorn']
32         extensions: ['js']
33 }).then(files => {
34         console.log(files);
35         //=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
36 });
37
38 dirGlob(['lib/**', 'fixtures'], {
39         files: ['test', 'unicorn', '*.jsx'],
40         extensions: ['js', 'png']
41 }).then(files => {
42         console.log(files);
43         //=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
44 });
45 ```
46
47
48 ## API
49
50 ### dirGlob(input, [options])
51
52 Returns a `Promise` for an array of glob strings.
53
54 ### dirGlob.sync(input, [options])
55
56 Returns an array of glob strings.
57
58 #### input
59
60 Type: `Array` `string`
61
62 A `string` or an `Array` of paths.
63
64 #### options
65
66 ##### extensions
67
68 Type: `Array`
69
70 Append extensions to the end of your globs.
71
72 ##### files
73
74 Type: `Array`
75
76 Only glob for certain files.
77
78 ##### cwd
79
80 Type: `string`
81
82 Test in specific directory.
83
84
85 ## License
86
87 MIT © [Kevin Mårtensson](https://github.com/kevva)