match-requires
Advanced tools
+21
| The MIT License (MIT) | ||
| Copyright (c) 2014-2016, Jon Schlinkert. | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
+6
-3
@@ -26,2 +26,3 @@ /*! | ||
| var res = []; | ||
| var re = regex(); | ||
| var match; | ||
@@ -31,7 +32,9 @@ | ||
| var line = lines[i++]; | ||
| if (match = regex().exec(line)) { | ||
| var match = re.exec(line); | ||
| if (match) { | ||
| res.push({ | ||
| line: i, | ||
| variable: match[2] || '', | ||
| module: match[3], | ||
| col: match.index, | ||
| variable: match[1] || '', | ||
| module: match[2], | ||
| original: line | ||
@@ -38,0 +41,0 @@ }); |
+24
-19
| { | ||
| "name": "match-requires", | ||
| "description": "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.", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "homepage": "https://github.com/jonschlinkert/match-requires", | ||
| "author": { | ||
| "name": "Jon Schlinkert", | ||
| "url": "https://github.com/jonschlinkert" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/jonschlinkert/match-requires.git" | ||
| }, | ||
| "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
| "repository": "jonschlinkert/match-requires", | ||
| "bugs": { | ||
| "url": "https://github.com/jonschlinkert/match-requires/issues" | ||
| }, | ||
| "license": { | ||
| "type": "MIT", | ||
| "url": "https://github.com/jonschlinkert/match-requires/blob/master/LICENSE-MIT" | ||
| }, | ||
| "license": "MIT", | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "main": "index.js", | ||
@@ -25,9 +19,8 @@ "engines": { | ||
| }, | ||
| "files": ["index.js"], | ||
| "scripts": { | ||
| "test": "mocha -R spec" | ||
| "test": "mocha" | ||
| }, | ||
| "dependencies": { | ||
| "requires-regex": "^0.2.0", | ||
| "strip-comments": "^0.3.2" | ||
| "requires-regex": "^0.3.1", | ||
| "strip-comments": "^0.4.3" | ||
| }, | ||
@@ -39,4 +32,5 @@ "devDependencies": { | ||
| "detective": "^4.0.0", | ||
| "gulp-format-md": "^0.1.4", | ||
| "mocha": "*", | ||
| "should": "^4.0.4" | ||
| "should": "*" | ||
| }, | ||
@@ -70,3 +64,14 @@ "keywords": [ | ||
| "test" | ||
| ] | ||
| ], | ||
| "verb": { | ||
| "related": { | ||
| "list": [ | ||
| "requires-regex" | ||
| ] | ||
| }, | ||
| "plugins": [ | ||
| "gulp-format-md" | ||
| ], | ||
| "layout": "default" | ||
| } | ||
| } |
+22
-20
@@ -1,17 +0,12 @@ | ||
| # match-requires [](http://badge.fury.io/js/match-requires) | ||
| # match-requires [](https://www.npmjs.com/package/match-requires) [](https://travis-ci.org/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. | ||
| - [benchmarks](#benchmarks) | ||
| - [usage](#usage) | ||
| - [tests](#tests) | ||
| - [Usage](#usage) | ||
| * [Code comments](#code-comments) | ||
| - [Benchmarks](#benchmarks) | ||
| - [License](#license) | ||
| _(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ | ||
| ## Install with [npm](npmjs.org) | ||
| ```bash | ||
| npm i match-requires --save | ||
| ``` | ||
| ## Usage | ||
@@ -99,25 +94,32 @@ | ||
| ## Related projects | ||
| ## Run tests | ||
| [requires-regex](https://www.npmjs.com/package/requires-regex): Regular expression for matching javascript require statements. | [homepage](https://github.com/jonschlinkert/requires-regex) | ||
| ## Running tests | ||
| Install dev dependencies: | ||
| ```bash | ||
| npm i -d && npm test | ||
| ```sh | ||
| $ 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/match-requires/issues/new). | ||
| ## Author | ||
| **Jon Schlinkert** | ||
| + [github/jonschlinkert](https://github.com/jonschlinkert) | ||
| + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
| * [github/jonschlinkert](https://github.com/jonschlinkert) | ||
| * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
| ## License | ||
| Copyright (c) 2015 Jon Schlinkert | ||
| Released under the MIT license | ||
| Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert) | ||
| Released under the MIT license. | ||
| *** | ||
| _This file was generated by [verb](https://github.com/assemble/verb) on January 22, 2015._ | ||
| _This file was generated by [verb](https://github.com/verbose/verb) on January 07, 2016._ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7296
32.8%4
33.33%37
8.82%124
1.64%7
16.67%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
Updated
Updated