pax_global_header00006660000000000000000000000064126314076520014520gustar00rootroot0000000000000052 comment=e41c3de8cbb3b1c20434ccaf4e99fc04a3268d6b node-modules-regexp-1.0.0/000077500000000000000000000000001263140765200154015ustar00rootroot00000000000000node-modules-regexp-1.0.0/.editorconfig000066400000000000000000000003471263140765200200620ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false node-modules-regexp-1.0.0/.gitattributes000066400000000000000000000000141263140765200202670ustar00rootroot00000000000000* text=auto node-modules-regexp-1.0.0/.gitignore000066400000000000000000000000151263140765200173650ustar00rootroot00000000000000node_modules node-modules-regexp-1.0.0/.travis.yml000066400000000000000000000000761263140765200175150ustar00rootroot00000000000000language: node_js node_js: - 'stable' - '0.12' - '0.10' node-modules-regexp-1.0.0/index.js000066400000000000000000000001131263140765200170410ustar00rootroot00000000000000'use strict'; module.exports = /^(?:.*[\\\/])?node_modules(?:[\\\/].*)?$/; node-modules-regexp-1.0.0/license000066400000000000000000000021401263140765200167430ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) James Talmage (github.com/jamestalmage) 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. node-modules-regexp-1.0.0/package.json000066400000000000000000000014661263140765200176760ustar00rootroot00000000000000{ "name": "node-modules-regexp", "version": "1.0.0", "description": "A regular expression for file paths that contain a `node_modules` folder.", "license": "MIT", "repository": "jamestalmage/node-modules-regexp", "author": { "name": "James Talmage", "email": "james@talmage.io", "url": "github.com/jamestalmage" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "node_modules", "regular expression", "regular expressions", "regular", "expression", "expressions", "exclude", "include", "ignore", "node", "module" ], "dependencies": {}, "devDependencies": { "ava": "^0.7.0", "xo": "^0.11.2" }, "xo": { "ignores": [ "test.js" ] } } node-modules-regexp-1.0.0/readme.md000066400000000000000000000013061263140765200171600ustar00rootroot00000000000000# node-modules-regexp [![Build Status](https://travis-ci.org/jamestalmage/node-modules-regexp.svg?branch=master)](https://travis-ci.org/jamestalmage/node-modules-regexp) > A regular expression for file paths that contain a `node_modules` folder. ## Install ``` $ npm install --save node-modules-regexp ``` ## Usage ```js const nodeModules = require('node-modules-regexp'); nodeModules.test('/foo/node_modules/bar.js'); //=> true nodeModules.test('/foo/bar.js'); //=> false ``` ## API The returned value is a regular expression, [soooo....](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp). ## License MIT © [James Talmage](http://github.com/jamestalmage) node-modules-regexp-1.0.0/test.js000066400000000000000000000012041263140765200167130ustar00rootroot00000000000000import test from 'ava'; import nm from './'; test(t => { t.true(nm.test('node_modules')); t.true(nm.test('node_modules/foo/bar.js')); t.true(nm.test('node_modules\\foo\\bar.js')); t.true(nm.test('./node_modules')); t.true(nm.test('.\\node_modules')); t.true(nm.test('/foo/bar/node_modules/blah.js')); t.true(nm.test('\\foo\\bar\\node_modules\\blah.js')); t.true(nm.test('node_modules/foo/bar.js')); t.true(nm.test('foo/node_modulesa/bar/node_modules/foo')); t.false(nm.test('foo/node_modulesa/bar/node_modulesb/foo')); t.false(nm.test('anode_modules')); t.false(nm.test('node_modulesb')); t.false(nm.test('node_modules.js')); });