# @gulpjs/to-absolute-glob

> Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.

Latest version **4.0.0** (published 2023-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gulpjs/to-absolute-glob
pnpm add @gulpjs/to-absolute-glob
yarn add @gulpjs/to-absolute-glob
bun add @gulpjs/to-absolute-glob
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-01-03 |
| First published | 2023-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gulp Team |
| Maintainers | yocontra, terinjokes, doowb, demurgos, callumacrae, phated, sttk, erikkemperman, tkellen, es128 |
| Keywords | absolute, file, filepath, glob, negate, negative, path, pattern, resolve, to |

## Links

- npm: https://www.npmjs.com/package/@gulpjs/to-absolute-glob
- Repository: https://github.com/gulpjs/to-absolute-glob
- Homepage: https://github.com/gulpjs/to-absolute-glob#readme
- Issues: https://github.com/gulpjs/to-absolute-glob/issues
- npm.io page: https://npm.io/package/@gulpjs/to-absolute-glob

## Dependencies (1)

- [is-negated-glob](https://npm.io/package/is-negated-glob.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2023-01-03

## README

<p align="center">
  <a href="http://gulpjs.com">
    <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  </a>
</p>

# @gulpjs/to-absolute-glob

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.

## Usage

```js
var toAbsoluteGlob = require('@gulpjs/to-absolute-glob');

// All these assume your cwd is `/dev/foo/`

toAbsoluteGlob('a/*.js') === '/dev/foo/a/*.js';

// Makes a path absolute
toAbsoluteGlob('a') === '/dev/foo/a';

// Retains trailing slashes
toAbsoluteGlob('a/*/') === '/dev/foo/a/*/';

// Makes a negative glob absolute
toAbsoluteGlob('!a/*.js') === '!/dev/foo/a/*.js';

// Accepts a cwd
toAbsoluteGlob('a/*.js', { cwd: 'foo' }) === '/dev/foo/foo/a/*.js';

// Accepts a root path
toAbsoluteGlob('/a/*.js', { root: 'baz' }) === '/dev/foo/baz/a/*.js';
```

## API

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

Takes a `glob` string and an optional `options` object and produces an absolute glob. If the glob is relative, the `root` or `cwd` option (or `process.cwd()` if neither specified) will be used as the base of the glob.

## License

MIT

<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/@gulpjs/to-absolute-glob.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@gulpjs/to-absolute-glob
[npm-image]: https://img.shields.io/npm/v/@gulpjs/to-absolute-glob.svg?style=flat-square

[ci-url]: https://github.com/gulpjs/to-absolute-glob/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/to-absolute-glob/dev.yml?branch=master&style=flat-square

[coveralls-url]: https://coveralls.io/r/gulpjs/to-absolute-glob
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/to-absolute-glob/master.svg?style=flat-square
<!-- prettier-ignore-end -->

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