{"name":"requires-regex","description":"Regular expression for matching javascript require statements.","version":"0.3.3","homepage":"https://github.com/jonschlinkert/requires-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/requires-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/requires-regex/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"keywords":["exec","expression","expressions","find","match","matcher","matches","matching","module","modules","re","regex","regexp","regular","require","requires","statement","test"],"verb":{"related":{"list":["lint-deps","match-requires","regex-cache"]},"layout":"default","plugins":["gulp-format-md"]},"gitHead":"29183dc5846748f6c9435a67ffb766fb44df4e44","_id":"requires-regex@0.3.3","_shasum":"60309eaabbfd5ca8259e090b8b5a94b2144eb0dd","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"60309eaabbfd5ca8259e090b8b5a94b2144eb0dd","tarball":"http://registry-npm.ywwl.com/requires-regex/download/requires-regex-0.3.3.tgz","integrity":"sha512-iOTuoKGShSHX2fofVPuituRuq11vKYsjg75f3oKTgbXZpSajzyiKxPRLDpbNeSgP2vfRX0lCaobu187x4W0hYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvGV9h9REpr+3hXR87mfwaA93oAcEvkcvz/LKfVlMYogIgFtiOF7CQn5ZptbsRmEPdba8sw/NJ9yBYbLcCPm0LYfs="}],"size":2226,"noattachment":false,"key":"/requires-regex/-/requires-regex-0.3.3.tgz"},"directories":{},"readme":"# requires-regex [![NPM version](https://img.shields.io/npm/v/requires-regex.svg?style=flat)](https://www.npmjs.com/package/requires-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/requires-regex.svg?style=flat)](https://npmjs.org/package/requires-regex) [![NPM total downloads](https://img.shields.io/npm/dt/requires-regex.svg?style=flat)](https://npmjs.org/package/requires-regex) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/requires-regex.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/requires-regex)\n\n> Regular expression for matching javascript require statements.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save requires-regex\n```\n\n## Usage\n\nTHe main export is a function that must be called. This ensures that a new regex is returned each time the function is called.\n\n```js\nconst regex = require('requires-regex')();\nconst match = regex.exec('const foo = require(\\'@bar/baz\\');');\n\nconsole.log(match);\n// [ 'const foo = require(\\'@bar/baz\\');',\n//   undefined,\n//   'foo',\n//   '\\'',\n//   '@bar/baz',\n//   'bar',\n//   'baz',\n//   index: 0,\n//   input: 'const foo = require(\\'@bar/baz\\');' ]\n```\n\n**Match results**\n\n* `0` - the full match\n* `1` - require statements inside quoted strings, otherwise undefined.\n* `2` - variable name before `require()`, if defined, otherwise undefined\n* `3` - leading quote inside `require()`, this is used as a reference to match ends on a trailing quote of the same type\n* `4` - the full name inside the `require()` statement. For example, in `require(\"@foo/bar\")`, the full name is `@foo/bar`.\n* `5` - the first segment of a scoped name. For example, `foo` in `@foo/bar`. Otherwise undefined.\n* `6` - the second segment of a scoped name. For example, `bar` in `@foo/bar`. Otherwise undefined.\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://github.com/jonschlinkert/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps \"CLI tool that tells you when dependencies are missing from package.json and offers you a choice to install them. Also tells you when dependencies are listed in package.json but are not being used anywhere in your project. Node.js command line tool and API\")\n* [match-requires](https://www.npmjs.com/package/match-requires): Match require statements in a string. Returns an array of matching require statements. Each match… [more](https://github.com/jonschlinkert/match-requires) | [homepage](https://github.com/jonschlinkert/match-requires \"Match require statements in a string. Returns an array of matching require statements. Each match is an object with line number, variable name, and module name. Statements in code comments are ignored.\")\n* [regex-cache](https://www.npmjs.com/package/regex-cache): Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of… [more](https://github.com/jonschlinkert/regex-cache) | [homepage](https://github.com/jonschlinkert/regex-cache \"Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 22 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [alvinsight](https://github.com/alvinsight) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 15, 2018._","publish_time":1452231462186,"_cnpm_publish_time":1452231462186,"dist-tags":{"latest":"1.0.4"}}