.gitignore added
[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(['lib/**', 'fixtures'], {
24         files: ['test', 'unicorn']
25         extensions: ['js']
26 }).then(files => {
27         console.log(files);
28         //=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
29 });
30
31 dirGlob(['lib/**', 'fixtures'], {
32         files: ['test', 'unicorn', '*.jsx'],
33         extensions: ['js', 'png']
34 }).then(files => {
35         console.log(files);
36         //=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
37 });
38 ```
39
40
41 ## API
42
43 ### dirGlob(input, [options])
44
45 Returns a `Promise` for an array of glob strings.
46
47 ### dirGlob.sync(input, [options])
48
49 Returns an array of glob strings.
50
51 #### input
52
53 Type: `Array` `string`
54
55 A `string` or an `Array` of paths.
56
57 #### options
58
59 ##### extensions
60
61 Type: `Array`
62
63 Append extensions to the end of your globs.
64
65 ##### files
66
67 Type: `Array`
68
69 Only glob for certain files.
70
71
72 ## License
73
74 MIT © [Kevin Mårtensson](https://github.com/kevva)