{"_id":"globrex","_rev":"96703","name":"globrex","description":"Glob to regular expression with support for extended globs","dist-tags":{"latest":"0.1.2"},"maintainers":[{"name":"terkelg","email":""}],"time":{"modified":"2023-03-27T07:52:51.000Z","created":"2018-04-10T05:59:22.840Z","0.1.2":"2018-12-16T15:34:52.391Z","0.1.1":"2018-05-13T21:46:47.836Z","0.1.0":"2018-05-13T20:39:28.219Z","0.0.3":"2018-04-24T06:16:10.217Z","0.0.2":"2018-04-10T07:32:12.426Z","0.0.1":"2018-04-10T07:22:00.146Z","0.0.0":"2018-04-10T05:59:22.840Z"},"users":{},"author":{"name":"Terkel Gjervig"},"repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"versions":{"0.1.2":{"name":"globrex","version":"0.1.2","description":"Glob to regular expression with support for extended globs","main":"index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"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":"9f6521b4a97664b2270b01de1f44a371a425e298","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.11.0","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"dd5d9ec826232730cd6793a5e33a9302985e6098","size":4872,"noattachment":false,"key":"/globrex/-/globrex-0.1.2.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.1.2.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.1.2_1544974492276_0.7740345065145231"},"_hasShrinkwrap":false,"publish_time":1544974492391,"_cnpm_publish_time":1544974492391},"0.1.1":{"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":{"shasum":"cfe565cfa910707d0ef98eb0b9d78c3c055ca2ef","size":4880,"noattachment":false,"key":"/globrex/-/globrex-0.1.1.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.1.1.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.1.1_1526248007766_0.615158373113109"},"_hasShrinkwrap":false,"publish_time":1526248007836,"_cnpm_publish_time":1526248007836},"0.1.0":{"name":"globrex","version":"0.1.0","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":"6c8eb7c2aa5207b38ffdf50217d23fc6860778cc","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.1.0","_npmVersion":"5.8.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"e3fbf2bd5774fc444664d554b5b9eb0062d4075d","size":4870,"noattachment":false,"key":"/globrex/-/globrex-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.1.0.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.1.0_1526243968137_0.5884940245448702"},"_hasShrinkwrap":false,"publish_time":1526243968219,"_cnpm_publish_time":1526243968219},"0.0.3":{"name":"globrex","version":"0.0.3","description":"Glob to regex","main":"src/index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"files":["src"],"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":"b4d53158777d7a54fb2c8f2e7f5e7a68643125ed","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.0.3","_npmVersion":"5.8.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"8b8c2ad052fccc58991381aff42fb76a876fea37","size":4584,"noattachment":false,"key":"/globrex/-/globrex-0.0.3.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.0.3.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.0.3_1524550570138_0.342478748347373"},"_hasShrinkwrap":false,"publish_time":1524550570217,"_cnpm_publish_time":1524550570217},"0.0.2":{"name":"globrex","version":"0.0.2","description":"Glob to regex","main":"src/index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"files":["src"],"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":"e8b879917f5555e5a56b84125849136a64992925","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"9fbdfeee1e3edd878d61ebda19fa57a999850ca4","size":4532,"noattachment":false,"key":"/globrex/-/globrex-0.0.2.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.0.2.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.0.2_1523345532346_0.3334956664530384"},"_hasShrinkwrap":false,"publish_time":1523345532426,"_cnpm_publish_time":1523345532426},"0.0.1":{"name":"globrex","version":"0.0.1","description":"Glob to regex","main":"src/index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"files":["src"],"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":"3b89a97c90631ed0cc09b52a4aac359b81b4115f","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"0d9fcb2a1546e8deb65dd5b93c29a658043040c1","size":4498,"noattachment":false,"key":"/globrex/-/globrex-0.0.1.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.0.1.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.0.1_1523344920089_0.8955753520088621"},"_hasShrinkwrap":false,"publish_time":1523344920146,"_cnpm_publish_time":1523344920146},"0.0.0":{"name":"globrex","version":"0.0.0","description":"Transform globs into RegExp","main":"src/index.js","author":{"name":"Terkel Gjervig"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/terkelg/globrex.git"},"files":["src"],"keywords":["glob","regex","regexp","parser","glob2regx","compiler"],"scripts":{"test":"tape test/*.js | tap-spec"},"devDependencies":{"tap-spec":"^4.1.1","tape":"^4.8.0"},"bugs":{"url":"https://github.com/terkelg/globrex/issues"},"homepage":"https://github.com/terkelg/globrex#readme","_id":"globrex@0.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"terkelg","email":"terkel@terkel.com"},"dist":{"shasum":"6aee665877248de265990de9cef4131d74aa8f03","size":3726,"noattachment":false,"key":"/globrex/-/globrex-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/globrex/download/globrex-0.0.0.tgz"},"maintainers":[{"name":"terkelg","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.0.0_1523339962763_0.4931726659487192"},"_hasShrinkwrap":false,"publish_time":1523339962840,"_cnpm_publish_time":1523339962840}},"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","_attachments":{},"homepage":"https://github.com/terkelg/globrex#readme","bugs":{"url":"https://github.com/terkelg/globrex/issues"},"license":"MIT"}