All Projects → micromatch → to-absolute-glob

micromatch / to-absolute-glob

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to to-absolute-glob

matched
Glob matching with support for multiple patterns and negation. Use `~` in cwd to find files in user home, or `@` for global npm modules.
Stars: ✭ 25 (+56.25%)
Mutual labels:  pattern, glob, glob-pattern
Micromatch
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Stars: ✭ 1,979 (+12268.75%)
Mutual labels:  glob, glob-pattern
glob-tool
A tool to test globs against sets of test strings quickly and easily for the DigitalOcean Community.
Stars: ✭ 14 (-12.5%)
Mutual labels:  glob, glob-pattern
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (+225%)
Mutual labels:  pattern, glob
glob
Pure Nim library for matching file paths against Unix style glob patterns.
Stars: ✭ 58 (+262.5%)
Mutual labels:  pattern, glob
is-valid-glob
Return true if a value is a valid glob pattern string, or array of glob patterns.
Stars: ✭ 21 (+31.25%)
Mutual labels:  glob, glob-pattern
dots
Implements the wildcard file matching in Go used by golint, go test etc.
Stars: ✭ 26 (+62.5%)
Mutual labels:  glob, glob-pattern
glob-fs
file globbing for node.js. speedy and powerful alternative to node-glob. This library is experimental and does not work on windows!
Stars: ✭ 54 (+237.5%)
Mutual labels:  glob, glob-pattern
bash-glob
Bash-powered globbing for node.js. Alternative to node-glob. Does not work on Windows 9 and lower.
Stars: ✭ 13 (-18.75%)
Mutual labels:  pattern, glob
extglob
Extended globs. Add (almost) the expressive power of regular expressions to glob patterns.
Stars: ✭ 25 (+56.25%)
Mutual labels:  pattern, glob
Glob
Go glob
Stars: ✭ 670 (+4087.5%)
Mutual labels:  pattern, glob
deglob
📂 Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.
Stars: ✭ 38 (+137.5%)
Mutual labels:  glob, glob-pattern
faster-than-walk
Faster recursive directory walk on Python 3
Stars: ✭ 36 (+125%)
Mutual labels:  glob, glob-pattern
dir-glob
Convert directories to glob compatible strings
Stars: ✭ 41 (+156.25%)
Mutual labels:  pattern, glob
Nanomatch
Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but without support for extended globs (extglobs), posix brackets or braces, and with complete Bash 4.3 wildcard support: ("*", "**", and "?").
Stars: ✭ 79 (+393.75%)
Mutual labels:  pattern, glob
Globbing
Introduction to "globbing" or glob matching, a programming concept that allows "filepath expansion" and matching using wildcards.
Stars: ✭ 86 (+437.5%)
Mutual labels:  pattern, glob
receptacle
minimalistic implementation of the repository pattern
Stars: ✭ 18 (+12.5%)
Mutual labels:  pattern
BinFind
Perform regex pattern matching on binary data. (Regex-like)
Stars: ✭ 31 (+93.75%)
Mutual labels:  pattern
globify
Run browserify and watchify with globs - even on Windows!
Stars: ✭ 16 (+0%)
Mutual labels:  glob-pattern
html-comment-regex
Regular expression for matching HTML comments
Stars: ✭ 15 (-6.25%)
Mutual labels:  pattern

to-absolute-glob NPM version NPM downloads Linux Build Status Windows Build Status

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

Install

Install with npm:

$ npm install --save to-absolute-glob

Usage

var toAbsGlob = require('to-absolute-glob');
toAbsGlob('a/*.js');
//=> '/dev/foo/a/*.js'

Examples

Given the current project folder (cwd) is /dev/foo/:

makes a path absolute

toAbsGlob('a');
//=> '/dev/foo/a'

makes a glob absolute

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

retains trailing slashes

toAbsGlob('a/*/');
//=> '/dev/foo/a/*/'

retains trailing slashes with cwd

toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname});
//=> '/dev/foo/'

makes a negative glob absolute

toAbsGlob('!a/*.js');
//=> '!/dev/foo/a/*.js'

from a cwd

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

makes a negative glob absolute from a cwd

toAbsGlob('!a/*.js', {cwd: 'foo'});
//=> '!/dev/foo/foo/a/*.js'

from a root path

toAbsGlob('/a/*.js', {root: 'baz'});
//=> '/dev/foo/baz/a/*.js'

from a root slash

toAbsGlob('/a/*.js', {root: '/'});
//=> '/dev/foo/a/*.js'

from a negative root path

toAbsGlob('!/a/*.js', {root: 'baz'});
//=> '!/dev/foo/baz/a/*.js'

from a negative root slash

toAbsGlob('!/a/*.js', {root: '/'});
//=> '!/dev/foo/a/*.js'

About

Related projects

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

Commits Contributor
16 doowb
15 jonschlinkert
1 phated
1 erikkemperman

Building docs

(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)

To generate the readme and API documentation with verb:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb-generate-readme, v0.2.0, on October 17, 2016.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].