# glob-promise

> Promise version of glob

Latest version **6.0.7** (published 2024-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install glob-promise
pnpm add glob-promise
yarn add glob-promise
bun add glob-promise
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.7 |
| Published | 2024-06-13 |
| First published | 2015-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 54 |
| Author | Ahmad Nassri |
| Maintainers | ahmadnassri |
| Keywords | glob, promise |

## Links

- npm: https://www.npmjs.com/package/glob-promise
- Repository: https://github.com/ahmadnassri/node-glob-promise
- Issues: https://github.com/ahmadnassri/node-glob-promise/issues
- Funding: https://github.com/sponsors/ahmadnassri
- npm.io page: https://npm.io/package/glob-promise

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 6.0.7 (latest) — 2024-06-13
- 6.0.6 — 2024-06-13
- 6.0.5 — 2023-09-03
- 6.0.4 — 2023-09-03
- 6.0.3 — 2023-06-10
- 6.0.2 — 2023-01-20
- 6.0.1 — 2023-01-02
- 6.0.0 — 2022-12-21
- 5.0.1 — 2022-12-19
- 5.0.0 — 2022-07-28
- 4.2.2 — 2021-10-22
- 4.2.1 — 2021-10-12
- 4.2.0 — 2021-05-27
- 4.1.0 — 2021-02-28
- 4.0.1 — 2021-02-02
- … 14 more at https://npm.io/package/glob-promise/versions

## README

# Promise version of glob

Match files using the patterns the shell uses, like stars and stuff.

[![license][license-img]][license-url]
[![release][release-img]][release-url]
[![semantic][semantic-img]][semantic-url]

> ***Note**: This is just a [`Promise`][] wrapped version of [`glob`][]*

> \[!IMPORTANT\]  
> [Glob][`glob`] has native Promise support as of `v9.0.0`, please use it directly.
> I will not issue a deprecation notice on this package, because I can't deal with the volume of angry tickets that will follow.

## Install

``` bash
npm install glob-promise glob
```

###### NOTE

[`glob`][] is set as a `peerDependency` in [`package.json`][]

- `npm` \>= 7 will automatically install `peerDependencies`
- `npm` \<= 6 will **not** automatically install `peerDependencies`.

You will need to manually add `glob` as a dependency to your project for `glob-promise` to work.

## API

### `glob(pattern [, options])`

Alias for `glob.promise`

### `glob.promise(pattern [, options])`

*pattern*: `String` (glob pattern)
*options*: `Object` or `String`
Return: `Object` ([Promise][`Promise`])

When it finishes, it will be [*fulfilled*][] with an `Array` of filenames as its first argument.

When it fails to read the files, it will be [*rejected*][] with an error as its first argument.

``` js
glob('**/*')
  .then(function(contents) {
    contents; //=> ['lorem', 'ipsum', 'dolor']
  });

glob('{foo,bar.baz}.txt', { nobrace: true })
  .then(function(contents) {
    contents; //=> []
  });
```

### `glob.glob(pattern [, options], cb)`

> see [`glob`][1]

### `glob.sync(pattern [, options])`

> see [`glob.sync()`][]

### `glob.hasMagic(pattern, [options])`

> see [`glob.hasMagic()`][]

### `Class: glob.Glob`

> see [`Glob`][2]

#### options

The option object will be directly passed to [glob][].

  [`Promise`]: http://promisesaplus.com/
  [`glob`]: https://github.com/isaacs/node-glob
  [`package.json`]: package.json
  [*fulfilled*]: http://promisesaplus.com/#point-26
  [*rejected*]: http://promisesaplus.com/#point-30
  [1]: https://github.com/isaacs/node-glob#globpattern-options-cb
  [`glob.sync()`]: https://github.com/isaacs/node-glob#globsyncpattern-options
  [`glob.hasMagic()`]: https://github.com/isaacs/node-glob#globhasmagicpattern-options
  [2]: https://github.com/isaacs/node-glob#class-globglob
  [glob]: https://github.com/isaacs/node-glob#options

----
> Author: [Ahmad Nassri](https://www.ahmadnassri.com/) &bull;
> Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)

[license-url]: LICENSE
[license-img]: https://badgen.net/github/license/ahmadnassri/node-glob-promise

[release-url]: https://github.com/ahmadnassri/node-glob-promise/releases
[release-img]: https://badgen.net/github/release/ahmadnassri/node-glob-promise

[semantic-url]: https://github.com/ahmadnassri/node-glob-promise/actions?query=workflow%3Arelease
[semantic-img]: https://badgen.net/badge/📦/semantically%20released/blue

---
_Source: https://npm.io/package/glob-promise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
