All Projects → kevva → dir-glob

kevva / dir-glob

Licence: MIT license
Convert directories to glob compatible strings

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to dir-glob

Globby
User-friendly glob matching
Stars: ✭ 1,864 (+4446.34%)
Mutual labels:  matching, glob, directories, globbing
extglob
Extended globs. Add (almost) the expressive power of regular expressions to glob patterns.
Stars: ✭ 25 (-39.02%)
Mutual labels:  pattern, glob, globbing
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (+26.83%)
Mutual labels:  pattern, glob, globbing
Ts Pattern
🎨 A complete Pattern Matching library for TypeScript, with smart type inference.
Stars: ✭ 854 (+1982.93%)
Mutual labels:  matching, pattern
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 (+92.68%)
Mutual labels:  pattern, glob
Globbing
Introduction to "globbing" or glob matching, a programming concept that allows "filepath expansion" and matching using wildcards.
Stars: ✭ 86 (+109.76%)
Mutual labels:  pattern, glob
Motif
Recursive, data driven pattern matching for Clojure
Stars: ✭ 63 (+53.66%)
Mutual labels:  matching, pattern
Is Glob
If you use globs, this will make your code faster. Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. 55+ million downloads.
Stars: ✭ 63 (+53.66%)
Mutual labels:  matching, glob
Pattern Matching Ts
⚡ Pattern Matching in Typescript
Stars: ✭ 107 (+160.98%)
Mutual labels:  matching, pattern
chemin
🥾 A type-safe pattern builder & route matching library written in TypeScript
Stars: ✭ 37 (-9.76%)
Mutual labels:  matching, pattern
koa-ip-filter
koa middleware to filter request IPs or custom ID with glob patterns, array, string, regexp or matcher function. Support custom 403 Forbidden message and custom ID.
Stars: ✭ 23 (-43.9%)
Mutual labels:  matching, glob
glob
Pure Nim library for matching file paths against Unix style glob patterns.
Stars: ✭ 58 (+41.46%)
Mutual labels:  pattern, glob
Glob
Go glob
Stars: ✭ 670 (+1534.15%)
Mutual labels:  pattern, glob
allot
Parse placeholder and wildcard text commands
Stars: ✭ 51 (+24.39%)
Mutual labels:  matching, pattern
bash-glob
Bash-powered globbing for node.js. Alternative to node-glob. Does not work on Windows 9 and lower.
Stars: ✭ 13 (-68.29%)
Mutual labels:  pattern, glob
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 (+4726.83%)
Mutual labels:  glob, globbing
delete-empty
Recursively delete all empty folders in a directory and child directories.
Stars: ✭ 38 (-7.32%)
Mutual labels:  glob, directories
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 (-39.02%)
Mutual labels:  pattern, glob
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Stars: ✭ 16 (-60.98%)
Mutual labels:  pattern, glob
expand-brackets
Expand POSIX bracket expressions (character classes) in glob patterns.
Stars: ✭ 26 (-36.59%)
Mutual labels:  glob, globbing

dir-glob Build Status

Convert directories to glob compatible strings

Install

$ npm install dir-glob

Usage

const dirGlob = require('dir-glob');

(async () => {
	console.log(await dirGlob(['index.js', 'test.js', 'fixtures']));
	//=> ['index.js', 'test.js', 'fixtures/**']

	console.log(await dirGlob(['index.js', 'inner_folder'], {cwd: 'fixtures'}));
	//=> ['index.js', 'inner_folder/**']

	console.log(await dirGlob(['lib/**', 'fixtures'], {
		files: ['test', 'unicorn']
		extensions: ['js']
	}));
	//=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']

	console.log(await dirGlob(['lib/**', 'fixtures'], {
		files: ['test', 'unicorn', '*.jsx'],
		extensions: ['js', 'png']
	}));
	//=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
})();

API

dirGlob(input, options?)

Returns a Promise<string[]> with globs.

dirGlob.sync(input, options?)

Returns a string[] with globs.

input

Type: string | string[]

Paths.

options

Type: object

extensions

Type: string[]

Append extensions to the end of your globs.

files

Type: string[]

Only glob for certain files.

cwd

Type: string[]

Test in specific directory.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
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].