{"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":{"integrity":"sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==","shasum":"dd5d9ec826232730cd6793a5e33a9302985e6098","tarball":"http://registry-npm.ywwl.com/globrex/download/globrex-0.1.2.tgz","fileCount":4,"unpackedSize":14164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFnCcCRA9TVsSAnZWagAA5EgP/AvDYBrM3rzOAJTUoLHn\nAZhgp+Jiez7lxy6gEBs/mfb53BtNaeNGrYEevoK+gNerN738+vjy/5mZJ+Bl\n6tzX2j9HNMGMzVrUanYAfoYVTOjebOuUB0W13ZCbn3Bk3ifXpJ5FoJDZ98fQ\nRWr8j0EGyExUY1tbXopMqL49lqPcpzHJRKG9UGlwcSgpwTjX6vUmxhpq8555\nZGBzALRQ7S9SR6eyUVxvIETHMzJrMIsw4AYCLBIjVs5Syo118aPN72W7cL0o\ncFrgESgphjUUz+gxsBmDQG2NOnRIXaBGaejktqlxCNtCa17CZL66Zg9LRdyC\nun73o4wNggcCkSMo41xBBLGgX97kJ65angoyGiRJ5LeDswaujHIRs/AQmqGk\n0Gt1JWluNfwoINCJm5hk0cNakiLE2Bp7Y58WIIp7r5zccoD/TjTwQc2zTtAJ\n5K8wO+gj2sCmpVM8BwJt6ROoRlFpWK2SSWtTKrpU/eSfIO9ipWoWaBDqpTDv\ndoRvZx5P2rzY0GGEkWV6tgLZ9QDZbGKpm6k2UkS5X+rm9bEyb08Qocr47BmM\nTS9/JYB+RMlUJ0SbmO2gx+fUTvZrqrVa/uNCdXd4IffvDsjdJ1ud5qTTMvxL\naYFXMg2kS7zCWF/9WFlmlHP7QwNA4oGAi/GQM3oPThnCrs224EeGtKxyL1u6\n4tyZ\r\n=VDmX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4hSvGZgTW2m6vo3pCtA0njjQ7GczRX4NPzzn/dbAp4QIgDDwd5stJluBCeFNn8wYFGnqSynGNN0PsLHr6ZhVZD+A="}],"size":4872,"noattachment":false,"key":"/globrex/-/globrex-0.1.2.tgz"},"maintainers":[{"name":"terkelg","email":"terkel@terkel.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/globrex_0.1.2_1544974492276_0.7740345065145231"},"_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":1544974492391,"_cnpm_publish_time":1544974492391,"dist-tags":{"latest":"0.1.2"}}