@gulpjs/to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Last updated 3 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @gulpjs/to-absolute-glob 
SYNC missed versions from official npm registry.

@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.

License

MIT

Current Tags

  • 4.0.0                                ...           latest (3 years ago)

1 Versions

  • 4.0.0                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |