Skip to content

About

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

Resources

Security policy

Stars

0 stars

Watchers

2 watching

Forks

 
 

Repository files navigation

@gulpjs/to-absolute-glob

NPM version Downloads Build Status Coveralls Status

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

Usage

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.

Strict No LLM / No AI Policy

No LLMs for issues.

No LLMs for patches / pull requests.

No LLMs for comments on the bug tracker, including translation.

English is encouraged, but not required. You are welcome to post in your native language and rely on others to have their own translation tools of choice to interpret your words.

License

MIT

About

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

Resources

Security policy

Stars

0 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages