diff options
Diffstat (limited to 'node_modules/anymatch/README.md')
-rw-r--r-- | node_modules/anymatch/README.md | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/node_modules/anymatch/README.md b/node_modules/anymatch/README.md index 0a6329213..62f65da87 100644 --- a/node_modules/anymatch/README.md +++ b/node_modules/anymatch/README.md @@ -38,7 +38,7 @@ var anymatch = require('anymatch'); var matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', - /foo.js$/, + /foo\.js$/, function (string) { return string.indexOf('bar') !== -1 && string.length > 10 } @@ -58,6 +58,13 @@ anymatch(matchers, 'path/anyjs/foo.js', true); // 1 anymatch(matchers, 'path/to/file.js', false, 1); // false anymatch(matchers, 'path/anyjs/foo.js', true, 2, 3); // 2 anymatch(matchers, 'path/to/bar.js', true, 0, 3); // -1 + +// using globs to match directories and their children +anymatch('node_modules', 'node_modules'); // true +anymatch('node_modules', 'node_modules/somelib/index.js'); // false +anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true +anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false +anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true ``` #### anymatch (matchers) |