# parse-glob [![NPM version](https://badge.fury.io/js/parse-glob.svg)](http://badge.fury.io/js/parse-glob) > Parse a glob pattern into an object of path parts. ## Install with [npm](npmjs.org) ```bash npm i parse-glob --save ``` ## Usage ```js var parse = require('parse-glob'); // this is a nonsensical pattern, but it shows what this lib does parse('a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js'); ``` Returns: ```js { isGlob: true, pattern: 'a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js', dirname: 'a/b/{c,.gitignore,{a,b}}/{a,b}/', filename: '*.foo.js', basename: '*', extname: '.foo.js', ext: 'js', // detects when a glob pattern intentionally // specifies dotfiles or dot directories (e.g. './.git/') dotfiles: false, dotdirs: false } ``` See the tests for [hundreds of examples](./test.js). ## Run tests Install dev dependencies: ```bash npm i -d && npm test ``` ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-glob/issues) ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright (c) 2015 Jon Schlinkert Released under the MIT license *** _This file was generated by [verb](https://github.com/assemble/verb) on February 07, 2015._