All Projects → micromatch → is-valid-glob

micromatch / is-valid-glob

Licence: MIT license
Return true if a value is a valid glob pattern string, or array of glob patterns.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to is-valid-glob

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 (+157.14%)
Mutual labels:  glob, glob-pattern
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 (+19.05%)
Mutual labels:  glob, glob-pattern
is-relative
Returns `true` if a file path appears to be relative. Moved from the "relative" lib.
Stars: ✭ 13 (-38.1%)
Mutual labels:  path, filepath
readdir
Recursively read a directory, blazing fast. Use with picomatch or micromatch to match globs.
Stars: ✭ 37 (+76.19%)
Mutual labels:  path, jonschlinkert
faster-than-walk
Faster recursive directory walk on Python 3
Stars: ✭ 36 (+71.43%)
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 (-33.33%)
Mutual labels:  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 (+9323.81%)
Mutual labels:  glob, glob-pattern
datoteka
A filesystem toolset and storage implementation for Clojure.
Stars: ✭ 59 (+180.95%)
Mutual labels:  paths, path
path-dsl-rs
A Rust utility DSL and macro to help construct and modify Paths.
Stars: ✭ 19 (-9.52%)
Mutual labels:  paths, path
dots
Implements the wildcard file matching in Go used by golint, go test etc.
Stars: ✭ 26 (+23.81%)
Mutual labels:  glob, glob-pattern
global-prefix
Get the npm global path prefix. Same code used internally by npm.
Stars: ✭ 27 (+28.57%)
Mutual labels:  path, filepath
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Stars: ✭ 16 (-23.81%)
Mutual labels:  glob, glob-pattern
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 (+80.95%)
Mutual labels:  glob, glob-pattern
path-that-svg
Path that SVG!
Stars: ✭ 45 (+114.29%)
Mutual labels:  path
relative-path
Portable relative UTF-8 paths for Rust.
Stars: ✭ 54 (+157.14%)
Mutual labels:  path
react-svg-pathline
React component for drawing SVG path through set of points, smoothing the corners
Stars: ✭ 42 (+100%)
Mutual labels:  path
Pathslider
Numerical slider that follows a Bezier path
Stars: ✭ 15 (-28.57%)
Mutual labels:  path
repeat-element
Create an array by repeating the given string n times.
Stars: ✭ 19 (-9.52%)
Mutual labels:  jonschlinkert
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (+147.62%)
Mutual labels:  glob
llvm-epp
Efficient Path Profiling using LLVM
Stars: ✭ 16 (-23.81%)
Mutual labels:  path

is-valid-glob NPM version NPM monthly downloads NPM total downloads Linux Build Status

Return true if a value is a valid glob pattern or patterns.

Install

Install with npm:

$ npm install --save is-valid-glob

Usage

This really just checks to make sure that a pattern is either a string or array, and if it's an array it's either empty or consists of only strings.

var isValidGlob = require('is-valid-glob');

isValidGlob('foo/*.js');
//=> true

Valid patterns

isValidGlob('a');
isValidGlob('a.js');
isValidGlob('*.js');
isValidGlob(['a', 'b']);
//=> all true

Invalid patterns

isValidGlob();
isValidGlob('');
isValidGlob(null);
isValidGlob(undefined);
isValidGlob(new Buffer('foo'));
isValidGlob(['foo', [[]]]);
isValidGlob(['foo', [['bar']]]);
isValidGlob(['foo', {}]);
isValidGlob({});
isValidGlob([]);
isValidGlob(['']);
//=> all false

About

Related projects

  • is-glob: Returns true if the given string looks like a glob pattern or an extglob pattern… more | homepage
  • micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | homepage
  • vinyl-fs: Vinyl adapter for the file system | homepage
  • vinyl: Virtual file format. | homepage

Contributing

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

Contributors

Commits Contributor
9 jonschlinkert
2 contra

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on June 21, 2017.

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