package
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
npm install @gulpjs/to-absolute-globGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
6.5 kB
Includes dependencies.
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
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';
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.
MIT