{"name":"globrex","version":"0.1.1","description":"Glob to regular expression with support for extended globs","main":"src/index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"files":["index.js"],"keywords":["glob","regex","regexp","parser","glob2regx","compiler"],"scripts":{"test":"tape test/*.js | tap-spec"},"devDependencies":{"tap-spec":"^4.1.1","tape":"^4.8.0"},"gitHead":"420122d95f040c47d7fee5d32ff1318d34432ed0","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.1.1","_npmVersion":"5.8.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"integrity":"sha512-bqKcPhb+ZtrISivpu6oLmwIyINlPlzueO/BDCdfnzUeu7SYxnHTXmWP7uQI5PnQXc5yGXOscGBEGagloA2hcSw==","shasum":"cfe565cfa910707d0ef98eb0b9d78c3c055ca2ef","tarball":"http://registry-npm.ywwl.com/globrex/download/globrex-0.1.1.tgz","fileCount":4,"unpackedSize":14181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+LJICRA9TVsSAnZWagAAJJAP/0o3ip8TYQkCUbMxc/1S\nHN4WY0u2SDrrdiELHehy1GEz0jOTbt7E+S+JwnOw26H1js1MlfVM0BNtuW8K\n7qjXtPnrfobw4cjoOgvIzD5+kjcOqahFTXGFfND7uhFSUvHY3S6V+lkWHdfW\nyndnZxtBEmLUXq/y8PGOlaUCJuQYgQ55BhEfth4tIawjl0XFw6/1cWuAvPTl\nLVMpXTS3oEhsKzK9btjda0/UdepIJrtNIx8up+Ly4If/AtRvqNUd9jVzwLZi\nu1RBJQURa/IDod4uCE+4Ydymm5iWUsX8wVNkgfs5IDre49Q+dHNQ3xaKYDzf\ndOglKHPRnwjmKA4oEbS0OAgFSInlQoyH4am9TlOnxbUgwA+1J2EC9W0d9Jt/\nF14ECiKjKNQG9kLENCt0CgzMz8TWxtk7CIUjS0k5meV8Mfci/JQxFiv43Hb0\nygiKhX0mu+sUDoXEvtz5E1peI+GTMwwU/BXIid6kz0XhEIxnPivQruddbP9F\nokQgy0vzQb+4lVq8qimWHaZCS+X8Ec5R456jK3Lt6KHioD5S9SQRCO8IfCJR\n82eebAcH6qTVdU+rcUIwkV8qwFURxc8ZeuIQ2Dl/kyWqsafEvB6xzSgANz9n\nrR0z1aMf5wtlD7AvkDWj/faXlGEXGBEySy3Cvus3JpCbZK9WTBAQbMRSe7vJ\nhLs5\r\n=sU0U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD58hWx2Lh6QkMa2fw2zlP7QYMZKE5NtI3A1Iyf/ZiQbgIhALNMe7qajbUlTt01n3N0ldRS55dJCXOe/dnxnCvdJ53q"}],"size":4880,"noattachment":false,"key":"/globrex/-/globrex-0.1.1.tgz"},"maintainers":[{"name":"terkelg","email":"terkel@terkel.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.1.1_1526248007766_0.615158373113109"},"_hasShrinkwrap":false,"readme":"<div align=\"center\">\n  <img src=\"https://github.com/terkelg/globrex/raw/master/globrex.png\" alt=\"globrex\" width=\"500\" />\n</div>\n\n<h1 align=\"center\">globrex</h1>\n\n<div align=\"center\">\n  <a href=\"https://npmjs.org/package/globrex\">\n    <img src=\"https://img.shields.io/npm/v/globrex.svg\" alt=\"version\" />\n  </a>\n  <a href=\"https://travis-ci.org/terkelg/globrex\">\n    <img src=\"https://img.shields.io/travis/terkelg/globrex.svg\" alt=\"travis\" />\n  </a>\n  <a href=\"https://ci.appveyor.com/project/terkelg/globrex\">\n    <img src=\"https://ci.appveyor.com/api/projects/status/ecbnb3whibj5iqcj?svg=true\" alt=\"appveyor\" />\n  </a>\n  <a href=\"https://npmjs.org/package/globrex\">\n    <img src=\"https://img.shields.io/npm/dm/globrex.svg\" alt=\"downloads\" />\n  </a>\n</div>\n\n<div align=\"center\">Simple but powerful glob to regular expression compiler.</div>\n\n<br />\n\n\n## Install\n\n```\nnpm install globrex --save\n```\n\n\n## Core Features\n\n- 💪 **extended globbing:** transform advance `ExtGlob` features\n- 📦 **simple**: no dependencies\n- 🛣️ **paths**: split paths into multiple `RegExp` segments\n\n\n## Usage\n\n```js\nconst globrex = require('globrex');\n\nconst result = globrex('p*uck')\n// => { regex: /^p.*uck$/, string: '^p.*uck$', segments: [ /^p.*uck$/ ] }\n\nresult.regex.test('pluck'); // true\n```\n\n\n## API\n\n### globrex(glob, options)\n\nType: `function`<br>\nReturns: `Object`\n\nTransform globs intp regular expressions.\nReturns object with the following properties:\n\n\n#### regex\n\nType: `RegExp`\n\nJavaScript `RegExp` instance.\n\n> **Note**: Read more about how to use [RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN.\n\n\n#### path\n\nThis property only exists if the option `filepath` is true.\n\n> **Note:** `filepath` is `false` by default\n\n#### path.segments\n\nType: `Array`\n\nArray of `RegExp` instances seperated by `/`. \nThis can be usable when working with file paths or urls. \n\nExample array could be:\n```js\n[ /^foo$/, /^bar$/, /^([^\\/]*)$/, '^baz\\\\.(md|js|txt)$' ]\n```\n\n\n#### path.regex\n\nType: `RegExp`\n\nJavaScript `RegExp` instance build for testign against paths.\nThe regex have different path seperators depending on host OS.\n\n\n### glob\n\nType: `String`\n\nGlob string to transform.\n\n\n### options.extended\n\nType: `Boolean`<br>\nDefault: `false`\n\nEnable all advanced features from `extglob`.\n\nMatching so called \"extended\" globs pattern like single character matching, matching ranges of characters, group matching, etc.\n\n> **Note**: Interprets `[a-d]` as `[abcd]`. To match a literal `-`, include it as first or last character.\n\n\n### options.globstar\n\nType: `Boolean`<br>\nDefault: `false`\n\nWhen globstar is `false` globs like `'/foo/*'` are transformed to the following\n`'^\\/foo\\/.*$'` which will match any string beginning with `'/foo/'`.\n\nWhen the globstar option is `true`, the same `'/foo/*'` glob is transformed to\n`'^\\/foo\\/[^/]*$'` which will match any string beginning with `'/foo/'` that **does not have** a `'/'` to the right of it. `'/foo/*'` will match: `'/foo/bar'`, `'/foo/bar.txt'` but not `'/foo/bar/baz'` or `'/foo/bar/baz.txt'`.\n\n> **Note**: When globstar is `true`, `'/foo/**'` is equivelant to `'/foo/*'` when globstar is `false`.\n\n\n### options.strict\n\nType: `Boolean`<br>\nDefault: `false`\n\nBe forgiving about mutiple slashes, like `///` and make everything after the first `/` optional. This is how bash glob works.\n\n\n### options.flags\n\nType: `String`<br>\nDefault: `''`\n\nRegExp flags (e.g. `'i'` ) to pass to the RegExp constructor.\n\n\n### options.filepath\n\nType: `Boolean`<br>\nDefault: `false`\n\nParse input strings as it was a file path for special path related features. This feature only makes sense if the input is a POSIX path like `/foo/bar/hello.js` or URLs.\n\nWhen `true` the returned object will have an additional `path` object.\n\n- `segment`: Array containing a `RegExp` object for each path segment.\n- `regex`: OS specific file path `RegExp`. Path seperator used is based on the operating system.\n- `globstar`: Regex string used to test for globstars.\n\n> **Note: Please only use forward-slashes in file path glob expressions**\n> Though windows uses either `/` or `\\` as its path separator, only `/`\n> characters are used by this glob implementation.  You must use\n> forward-slashes **only** in glob expressions. Back-slashes will always\n> be interpreted as escape characters, not path separators.\n\n\n## References\n\nLearn more about advanced globbing here\n- [mywiki.wooledge.org/glob](http://mywiki.wooledge.org/glob)\n- [linuxjournal](http://www.linuxjournal.com/content/bash-extended-globbing)\n\n\n## License\n\nMIT © [Terkel Gjervig](https://terkel.com)\n","publish_time":1526248007836,"_cnpm_publish_time":1526248007836,"dist-tags":{"latest":"0.1.2"}}