Debian Codegraph @

workspaces/arborist/test/fixtures/registry-mocks/content/perf-regexes.json

raw
1 {
2 "_id": "perf-regexes",
3 "_rev": "5-7a93528a5893aacdeeae66300303e34e",
4 "name": "perf-regexes",
5 "description": "Optimized and powerful regexes for JavaScript",
6 "dist-tags": {
7 "latest": "1.0.1"
8 },
9 "versions": {
10 "0.0.1": {
11 "name": "perf-regexes",
12 "version": "0.0.1",
13 "description": "Optimized and powerful regexes for JavaScript",
14 "main": "dist/perf-regexes.cjs.js",
15 "jsnext:main": "dist/perf-regexes.es.js",
16 "engines": {
17 "node": ">=0.12"
18 },
19 "scripts": {
20 "test": "node-version-gte-4 && mocha || mocha --compilers js:./buble-register",
21 "lint": "node-version-gte-4 && eslint src test/index.js || node-version-lt-4",
22 "pretest": "npm run lint && npm run build",
23 "build": "rm -rf dist/* && npm run build:cjs && npm run build:es6",
24 "build:cjs": "rollup -c -f cjs -o dist/perf-regexes.cjs.js",
25 "build:es6": "rollup -c -f es -o dist/perf-regexes.es.js",
26 "prepublish": "npm test"
27 },
28 "files": [
29 "dist",
30 "src"
31 ],
32 "repository": {
33 "type": "git",
34 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
35 },
36 "keywords": [
37 "regex",
38 "regexes",
39 "javascript",
40 "modules",
41 "match",
42 "source"
43 ],
44 "author": {
45 "name": "aMarCruz",
46 "email": "[email protected]",
47 "url": "https://github.com/aMarCruz"
48 },
49 "license": "MIT",
50 "bugs": {
51 "url": "https://github.com/aMarCruz/perf-regexes/issues"
52 },
53 "homepage": "https://github.com/aMarCruz/perf-regexes",
54 "dependencies": {},
55 "devDependencies": {
56 "eslint": "^3.4.0",
57 "expect": "^1.20.2",
58 "mocha": "^3.0.2",
59 "node-version-check": "^2.1.1",
60 "rollup": "^0.34.13",
61 "rollup-plugin-buble": "^0.13.0"
62 },
63 "gitHead": "94a6e4f6d3729e862d82249ca7020a67889061f2",
64 "_id": "[email protected]",
65 "_shasum": "9e41c980bd724edf2e79dbb97af2f9b09d306f8f",
66 "_from": ".",
67 "_npmVersion": "3.10.3",
68 "_nodeVersion": "6.5.0",
69 "_npmUser": {
70 "name": "amarcruz",
71 "email": "[email protected]"
72 },
73 "dist": {
74 "shasum": "9e41c980bd724edf2e79dbb97af2f9b09d306f8f",
75 "tarball": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-0.0.1.tgz"
76 },
77 "maintainers": [
78 {
79 "name": "amarcruz",
80 "email": "[email protected]"
81 }
82 ],
83 "_npmOperationalInternal": {
84 "host": "packages-16-east.internal.npmjs.com",
85 "tmp": "tmp/perf-regexes-0.0.1.tgz_1473244182319_0.9009743514470756"
86 },
87 "directories": {}
88 },
89 "0.0.2": {
90 "name": "perf-regexes",
91 "version": "0.0.2",
92 "description": "Optimized and powerful regexes for JavaScript",
93 "main": "dist/perf-regexes.cjs.js",
94 "jsnext:main": "dist/perf-regexes.es.js",
95 "engines": {
96 "node": ">=0.12"
97 },
98 "scripts": {
99 "test": "node-version-gte-4 && mocha || mocha --compilers js:./buble-register",
100 "lint": "node-version-gte-4 && eslint src test/index.js || node-version-lt-4",
101 "pretest": "npm run lint && npm run build",
102 "build": "rm -rf dist/* && npm run build:cjs && npm run build:es6",
103 "build:cjs": "rollup -c -f cjs -o dist/perf-regexes.cjs.js",
104 "build:es6": "rollup -c -f es -o dist/perf-regexes.es.js",
105 "prepublish": "npm test"
106 },
107 "files": [
108 "dist",
109 "src"
110 ],
111 "repository": {
112 "type": "git",
113 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
114 },
115 "keywords": [
116 "regex",
117 "regexes",
118 "javascript",
119 "modules",
120 "match",
121 "source"
122 ],
123 "author": {
124 "name": "aMarCruz",
125 "email": "[email protected]",
126 "url": "https://github.com/aMarCruz"
127 },
128 "license": "MIT",
129 "bugs": {
130 "url": "https://github.com/aMarCruz/perf-regexes/issues"
131 },
132 "homepage": "https://github.com/aMarCruz/perf-regexes",
133 "dependencies": {},
134 "devDependencies": {
135 "eslint": "^3.4.0",
136 "expect": "^1.20.2",
137 "mocha": "^3.0.2",
138 "node-version-check": "^2.1.1",
139 "rollup": "^0.34.13",
140 "rollup-plugin-buble": "^0.13.0"
141 },
142 "gitHead": "6910f718c895a2e060eef52957a7ac7849d711cf",
143 "_id": "[email protected]",
144 "_shasum": "93783a6737de858af348b64a71c0f96e7df54d57",
145 "_from": ".",
146 "_npmVersion": "3.10.3",
147 "_nodeVersion": "6.5.0",
148 "_npmUser": {
149 "name": "amarcruz",
150 "email": "[email protected]"
151 },
152 "dist": {
153 "shasum": "93783a6737de858af348b64a71c0f96e7df54d57",
154 "tarball": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-0.0.2.tgz"
155 },
156 "maintainers": [
157 {
158 "name": "amarcruz",
159 "email": "[email protected]"
160 }
161 ],
162 "_npmOperationalInternal": {
163 "host": "packages-12-west.internal.npmjs.com",
164 "tmp": "tmp/perf-regexes-0.0.2.tgz_1473349457737_0.9960543322376907"
165 },
166 "directories": {}
167 },
168 "0.1.2": {
169 "name": "perf-regexes",
170 "version": "0.1.2",
171 "description": "Optimized and powerful regexes for JavaScript",
172 "main": "dist/perf-regexes.cjs.js",
173 "jsnext:main": "dist/perf-regexes.es.js",
174 "engines": {
175 "node": ">=0.12"
176 },
177 "scripts": {
178 "test": "npm run build:cjs && mocha",
179 "lint": "node-version-gte-4 && eslint src test/index.js || node-version-lt-4",
180 "build": "npm run build:cjs && npm run build:es6",
181 "build:cjs": "rollup -c -f cjs -o dist/perf-regexes.cjs.js",
182 "build:es6": "rollup -c -f es -o dist/perf-regexes.es.js",
183 "prepublish": "npm run lint && rm -rf dist/* && npm t && npm run build:es6"
184 },
185 "files": [
186 "dist",
187 "src"
188 ],
189 "repository": {
190 "type": "git",
191 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
192 },
193 "keywords": [
194 "regex",
195 "regexes",
196 "javascript",
197 "modules",
198 "match",
199 "source"
200 ],
201 "author": {
202 "name": "aMarCruz",
203 "email": "[email protected]",
204 "url": "https://github.com/aMarCruz"
205 },
206 "license": "MIT",
207 "bugs": {
208 "url": "https://github.com/aMarCruz/perf-regexes/issues"
209 },
210 "homepage": "https://github.com/aMarCruz/perf-regexes",
211 "dependencies": {},
212 "devDependencies": {
213 "eslint": "^3.4.0",
214 "expect": "^1.20.2",
215 "mocha": "^3.0.2",
216 "node-version-check": "^2.1.1",
217 "rollup": "^0.34.13"
218 },
219 "gitHead": "1d8474cb39f5f39dbc375ca49aa9727560a6197a",
220 "_id": "[email protected]",
221 "_shasum": "4e3838786d0513e7bf3fe0c3672297be94bc9751",
222 "_from": ".",
223 "_npmVersion": "3.10.5",
224 "_nodeVersion": "4.4.7",
225 "_npmUser": {
226 "name": "amarcruz",
227 "email": "[email protected]"
228 },
229 "dist": {
230 "shasum": "4e3838786d0513e7bf3fe0c3672297be94bc9751",
231 "tarball": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-0.1.2.tgz"
232 },
233 "maintainers": [
234 {
235 "name": "amarcruz",
236 "email": "[email protected]"
237 }
238 ],
239 "_npmOperationalInternal": {
240 "host": "packages-12-west.internal.npmjs.com",
241 "tmp": "tmp/perf-regexes-0.1.2.tgz_1474644324888_0.6301897945813835"
242 },
243 "directories": {}
244 },
245 "1.0.0": {
246 "name": "perf-regexes",
247 "version": "1.0.0",
248 "description": "Optimized and powerful regexes for JavaScript",
249 "main": "./dist/perf-regexes.js",
250 "module": "./dist/perf-regexes.mjs",
251 "browser": "index.min.js",
252 "types": "index.d.ts",
253 "source": "./src/index.js",
254 "engines": {
255 "node": ">=6.14"
256 },
257 "keywords": [
258 "html",
259 "javascript",
260 "typescript",
261 "comments",
262 "regexp",
263 "regexes",
264 "search",
265 "match",
266 "source"
267 ],
268 "scripts": {
269 "start": "rollup -c && mocha -w test/index.js",
270 "pretest": "rollup -c",
271 "test": "mocha test/index.js",
272 "prek": "rollup -c rollup.browser.js",
273 "k": "karma start ./test/karma.conf.js",
274 "lint": "eslint src/*.js test/*.js",
275 "build": "rollup -c && rollup -c rollup.browser.js",
276 "prepublish": "npm run lint && npm run prek && npm t"
277 },
278 "author": {
279 "name": "aMarCruz",
280 "email": "[email protected]",
281 "url": "https://github.com/aMarCruz"
282 },
283 "homepage": "https://github.com/aMarCruz/perf-regexes",
284 "bugs": {
285 "url": "https://github.com/aMarCruz/perf-regexes/issues"
286 },
287 "repository": {
288 "type": "git",
289 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
290 },
291 "license": "MIT",
292 "devDependencies": {
293 "eslint": "^5.10.0",
294 "expect": "^1.20.2",
295 "karma": "^3.1.4",
296 "karma-chrome-launcher": "^2.2.0",
297 "karma-firefox-launcher": "^1.1.0",
298 "karma-mocha": "^1.3.0",
299 "mocha": "^5.2.0",
300 "rollup": "^0.68.1",
301 "rollup-plugin-uglify": "^6.0.0",
302 "skip-regex": "^1.0.1"
303 },
304 "gitHead": "5a75e5f55ff15e1a9477408502d738557555231c",
305 "_id": "[email protected]",
306 "_npmVersion": "5.6.0",
307 "_nodeVersion": "8.11.2",
308 "_npmUser": {
309 "name": "amarcruz",
310 "email": "[email protected]"
311 },
312 "dist": {
313 "integrity": "sha512-WG4XJ5MelEw/rehwS39+oJZ4MBsqejgVB/PS7v/gSAX9oITNf6O43TBzPY9QMB0QIbWXtdpyZ2xgU7iPXe2LZQ==",
314 "shasum": "72df953e8a910657e5cff97b31f3a547704fc8a2",
315 "tarball": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-1.0.0.tgz",
316 "fileCount": 9,
317 "unpackedSize": 23073,
318 "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHtVSCRA9TVsSAnZWagAAiRAP/3x+rwGmv3l0bRuKFfYG\nHfDkxCYtWUz1364REtEVxWp2qhKwq5r5hJJsCxbAtUL2S6nPxQMOjqWlJwnx\nb7Rx/osDFWp3BnEfK01pwXBxEtFwl2UEhyhDdToi4ZTFFw8T+G/z1pLU/k92\nScKTRlspFwRoR+7ZaqAvRIEdUysVg7JYWeCTKYXl3NFbAfX3R5jCbPTrji+O\nCNjv5enF4raNXFihtU1E5DV4qQhUWJ0d2MYH6fGzFQqUo9phbXuPcJ4M/pDo\nCENDGJsRvXUp6A/rIGhyQmYGd9qQ1ynAWf7fOVEcGpjVvd6CdUCtKofyugND\n3p/aDMSqUBy6vI/6k1bO5O6qH622TIO7tEVcQ5LO6ZUpTol5jw4AJf3/2bs8\nn/1OjQ/aqkuRYkwedVY5Hvn/SahOOqnwmc/6ODyNVEuQb+4kruj2pjlcPGLm\nC1SDampLGqIv1K+rO7KBg0SauKK7qRGLtK3g6Ixb4l78z+C9sWQLNTGNsZ3E\nMbyRrB7ydm13pKeq0gJexwdHjCaTfL3w5Bi5rxQeoDKoCse+K8PkU/Lcyvn+\nLwO2beXVqicKy6o4e8npFzh87talpi2ZUVdfDXnbKLUOBxS15KIFc7KaEtMN\n8M9JR3MqGvNOsnBS/vCLoDdUHCW38Mme6slFLRAFHXnb6SDB7fI8B2RRASnn\nMfpo\r\n=fDLZ\r\n-----END PGP SIGNATURE-----\r\n"
319 },
320 "maintainers": [
321 {
322 "name": "amarcruz",
323 "email": "[email protected]"
324 }
325 ],
326 "directories": {},
327 "_npmOperationalInternal": {
328 "host": "s3://npm-registry-packages",
329 "tmp": "tmp/perf-regexes_1.0.0_1545524561664_0.7529000613346957"
330 },
331 "_hasShrinkwrap": false
332 },
333 "1.0.1": {
334 "name": "perf-regexes",
335 "version": "1.0.1",
336 "description": "Optimized and powerful regexes for JavaScript",
337 "main": "./dist/perf-regexes.js",
338 "module": "./dist/perf-regexes.mjs",
339 "browser": "index.min.js",
340 "types": "index.d.ts",
341 "source": "./src/index.js",
342 "engines": {
343 "node": ">=6.14"
344 },
345 "keywords": [
346 "html",
347 "javascript",
348 "typescript",
349 "comments",
350 "regexp",
351 "regexes",
352 "search",
353 "match",
354 "source"
355 ],
356 "scripts": {
357 "start": "rollup -c && mocha -w test/index.js",
358 "pretest": "rollup -c",
359 "test": "mocha test/index.js",
360 "prek": "rollup -c rollup.browser.js",
361 "k": "karma start ./test/karma.conf.js",
362 "lint": "eslint src/*.js test/*.js",
363 "build": "rollup -c && rollup -c rollup.browser.js",
364 "prepublish": "npm run lint && npm run prek && npm t"
365 },
366 "author": {
367 "name": "aMarCruz",
368 "email": "[email protected]",
369 "url": "https://github.com/aMarCruz"
370 },
371 "homepage": "https://github.com/aMarCruz/perf-regexes",
372 "bugs": {
373 "url": "https://github.com/aMarCruz/perf-regexes/issues"
374 },
375 "repository": {
376 "type": "git",
377 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
378 },
379 "license": "MIT",
380 "devDependencies": {
381 "eslint": "^5.10.0",
382 "expect": "^1.20.2",
383 "karma": "^3.1.4",
384 "karma-chrome-launcher": "^2.2.0",
385 "karma-firefox-launcher": "^1.1.0",
386 "karma-mocha": "^1.3.0",
387 "mocha": "^5.2.0",
388 "rollup": "^0.68.1",
389 "rollup-plugin-uglify": "^6.0.0",
390 "skip-regex": "^1.0.1"
391 },
392 "gitHead": "1fa787b085ddd4c58514c455472f37eb421eb924",
393 "_id": "[email protected]",
394 "_npmVersion": "5.6.0",
395 "_nodeVersion": "8.11.2",
396 "_npmUser": {
397 "name": "amarcruz",
398 "email": "[email protected]"
399 },
400 "dist": {
401 "integrity": "sha512-L7MXxUDtqr4PUaLFCDCXBfGV/6KLIuSEccizDI7JxT+c9x1G1v04BQ4+4oag84SHaCdrBgQAIs/Cqn+flwFPng==",
402 "shasum": "6da1d62f5a94bf9353a0451bccacf69068b75d0b",
403 "tarball": "https://registry.npmjs.org/perf-regexes/-/perf-regexes-1.0.1.tgz",
404 "fileCount": 9,
405 "unpackedSize": 23866,
406 "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcINstCRA9TVsSAnZWagAAqjUP/Ri822CLBa5rAq4sexjM\nSx/VvUE8CVjLYzq+BC+44VoB1rTrZ5I7WoKth2rLd+G67BPcwPJVjtkbcJRf\nGdCNElLUohB5N3dhavdXEeowmaJwd7bZWlXHsPD7mKB/0WvQks1uA5b7C/qw\nKBvUOFIxTSOZjE9m2q0ZnzM+z+NkLD5BUSSqc9qmDGDXJIBFsTqlCl4QqjAO\neYUzlsnTNDKiwkW7wW9HOWKB45lFOzLZeRBrS9/STKbVyI3ju6EY03tWYCh8\nQDcZOHwIifzfgHej2a1Rmczd4GtzAdKtiZoNVMTuHotxqoztUyPxf3ICBbYM\nc08mOf+B0XvG7Z5SHUB5hfwZiNRtt4Lc1UPV7gPfWcVbJ8JDBUx/AJD8eE+s\n/Tha94wd79dYKub3k2psNICajSDfXvcJwEBZy2nPEVkfq1dusDfiCnckkZzh\nU4GRrSgiK9eUSfaXsyn35BeO1WwH1l5vRhE/QyAzQX9dvSALxOvnlSmQv+ae\n++K/eh9/dhPZen1ChPmycVmxBX10bHk/EGAwhse+q49g+ZFGznMznvuzvkDa\n+ZJCtgAlS43adYGEx3n7j4+3/tKW4o6Bmh1Lksivcr31cwT+eSE61rRFsiJC\nT2twhSic12IhP9OooktBEtT9sdvG7bCoia+n16CNX7/TIK8XpPofS4J7ZHAz\n8ELy\r\n=dzNE\r\n-----END PGP SIGNATURE-----\r\n"
407 },
408 "maintainers": [
409 {
410 "name": "amarcruz",
411 "email": "[email protected]"
412 }
413 ],
414 "directories": {},
415 "_npmOperationalInternal": {
416 "host": "s3://npm-registry-packages",
417 "tmp": "tmp/perf-regexes_1.0.1_1545657132766_0.6527229299230055"
418 },
419 "_hasShrinkwrap": false
420 }
421 },
422 "readme": "# perf-regexes\n\nOptimized and powerful regexes for JavaScript\n\n[![npm Version][npm-badge]][npm-url]\n[![License][license-badge]][license-url]\n[![Build Status][build-badge]][build-url]\n[![Bundle Size][size-badge]][size-url]\n\n## Breaking Changes\n\nIn ES5, matching literal regexes with other regex in medium complexity code is highly risky.<br>In ES6 it is practically impossible.\n\nFor this reason, as of v1.0 `JS_REGEX_P` is deprecated and will be removed in the next minor version.\n\n`JS_REGEX` will be maintained, but its use should be limited to complement other utilities, such as [skip-regex](https://github.com/aMarCruz/skip-regex), which uses a customized version of `JS_REGEX` to identify regular expresions reliably.\n\nThe minimum supported version of NodeJS now is 6.14 (oldest maintained LTS version w/fixes).\n\n## Install\n\n```sh\nnpm install perf-regexes --save\n# or\nyarn add perf-regexes\n```\n\nIn the browser, this loads perf-regexes in the global `R` object:\n\n```html\n<script src=\"https://unpkg.com/perf-regexes/index.min.js\"></script>\n```\n\n## Included Regexes\n\nAll of these regexes recognize Win/Mac/Unix line-endings and are ready to be used, but you can customize them using the `RegExp` constructor and the `source` property of the desired regex.\n\nHTML:\n\nName | Flags | Matches\n---------- | :---: | -------\nHTML_CMNT | g | Valid HTML comments, according to the [SGML](https://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4) standard.\n\nJavaScript:\n\nName | Flags | Matches\n---------- | :---: | -------\nJS_MLCMNT | g | Multiline JS comment, with support for embedded `'/*'` sequences.\nJS_SLCMNT | g | Single-line JS comments, not including its line-ending.\nJS_DQSTR | g | Double quoted JS string, with support for escaped quotes and line-endings.\nJS_SQSTR | g | Single quoted JS string, with support for escaped quotes and line-endings.\nJS_STRING | g | Combines `JS_SQSTR` and `JS_DQSTR` to match single or double quoted strings.\nJS_REGEX | g | Regex. **Note:** The result must be validated.\nJS_REGEX_P | g | _Deprecated, do not use it._\n\nSelection of lines:\n\nName | Flags | Matches\n--------------- | :---: | -------\nEMPTY_LINES | gm | Empty line or line with only whitespace within, including its line-ending, if it has one.\nNON_EMPTY_LINES | gm | Line with at least one non-whitespace character, including its line-ending, if it has one.\nTRAILING_WS | gm | The trailing whitespace of a line, without including its line-ending.\nOPT_WS_EOL | g | Zero or more blank characters followed by a line-ending, or the final blanks, if the (last) line has no line-ending.\nEOL | g | Line-ending of any type\n\n### NOTE\n\nBecause the `'g'` flag, always set `lastIndex` or clone the regex before using it with the `exec` method.\n\n## Example\n\nUsing only one regex, this simple example will...\n\n- Remove trailing whitespace of each line.\n- Remove the empty lines.\n- Normalize the line-endings to unix style.\n\n```js\nconst R = require('perf-regexes')\n\nconst cleaner = (text) => text.split(R.OPT_WS_EOL).filter(Boolean).join('\\n')\n\nconsole.dir(cleaner(' \\r\\r\\n\\nAA\\t\\t\\t\\r\\n\\rBB\\nCC \\rDD '))\n// ⇒ 'AA\\nBB\\nCC\\nDD'\n```\n\nUse the previous function to cleanup HTML text:\n\n```js\nconst htmlCleaner = (html) => cleaner(html.replace(R.HTML_CMNT, ''))\n\nconsole.dir(htmlCleaner(\n '\\r<!--header--><h1>A</h1>\\r<div>B<br>\\r\\nC</div> <!--end-->\\n'))\n// ⇒ '<h1>A</h1>\\n<div>B<br>\\nC</div>'\n```\n\n### Line-endings Normalization\n\n```js\nconst R = require('perf-regexes')\n\nconst normalize = (text) => text.split(R.EOL).join('\\n')\n\nconsole.dir(normalize('\\rAA\\r\\r\\nBB\\r\\nCC \\nDD\\r'))\n// ⇒ '\\nAA\\n\\nBB\\nCC \\nDD\\n'\n```\n\n### Double-quoted to single-quoted strings\n\n```js\nconst toSingleQuotes = (text) => text.replace(R.JS_STRING, (str) => {\n return str[0] === '\"'\n ? `'${str.slice(1, -1).replace(/'/g, \"\\\\'\")}'`\n : str\n})\n\nconsole.log(toSingleQuotes(`\"A's\" 'B' \"C\"`))\n// ⇒ 'A\\'s' 'B' 'C'\n```\n\n### Matching Regexes\n\nWith the arrival of [ES6TL](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) and new keywords, finding literal regexes with another regex is not viable, you need a JS parser such as [acorn](https://www.npmjs.com/package/acorn) or a specialized one such as [skip-regex](https://www.npmjs.com/package/skip-regex) to do it correctly.\n\nThis is a very basic example that uses skip-regex:\n\n```js\nimport R from 'perf-regexes'\nimport skipRegex from 'skip-regex'\n\n/**\n * Source to match quoted string, comments, and slashes.\n * Captures en $1 the slash\n */\nconst reStr = `${R.JS_STRING.source}|${R.JS_MLCMNT.source}|${R.JS_SLCMNT.source}|(/)`\n\n/**\n * Search regexes in `code` and display the result to the console.\n */\nconst searchRegexes = (code) => {\n\n // Creating `re` here keeps its lastIndex private\n const re = RegExp(reStr, 'g')\n let match = re.exec(code)\n\n while (match) {\n if (match[1]) {\n const start = match.index\n const end = skipRegex(code, start)\n\n // skipRegex returns start+1 if this is not a regex\n if (end > start + 1) {\n console.log(`Found \"${code.slice(start, end)}\" at ${start}`)\n }\n re.lastIndex = end\n }\n match = re.exec(code)\n }\n}\n\nconst code = `\nconst A = 2\nconst s = '/A/' // must not find /A/\n\nconst re1 = /A/g // regex\nre1.lastIndex = 2 /A/ 1 // must not find /A/\n\n/* /B/ // must not find /B/\n*/\nconst re2 = /B/g // regex\nre1.exec(s || \"/B/\") // must not find /B/\n`\n\nsearchRegexes(code)\n// output:\n// Found \"/A/g\" at 74\n// Found \"/B/b\" at 210\n```\n\nThe previous code does not support ES6TL, but it works quite well on ES5 files and is very fast.\n\nFor a more complete example of using perf-regexes, see [js-cleanup](https://github.com/aMarCruz/js-cleanup), an advanced utility with support for ES6 that trims trailing spaces, compacts empty lines, normalizes line-endings, and removes comments conditionally.\n\n### ES6 Template Literals\n\nES6TLs are too complex to be identified by one single regex, do not even try.\n\n## Support my Work\n\nI'm a full-stack developer with more than 20 year of experience and I try to share most of my work for free and help others, but this takes a significant amount of time and effort so, if you like my work, please consider...\n\n[<img src=\"https://amarcruz.github.io/images/kofi_blue.png\" height=\"36\" title=\"Support Me on Ko-fi\" />][kofi-url]\n\nOf course, feedback, PRs, and stars are also welcome 🙃\n\nThanks for your support!\n\n## License\n\nThe [MIT License](LICENCE) (MIT)\n\n[build-badge]: https://img.shields.io/travis/aMarCruz/perf-regexes.svg\n[build-url]: https://travis-ci.org/aMarCruz/perf-regexes\n[npm-badge]: https://img.shields.io/npm/v/perf-regexes.svg\n[npm-url]: https://www.npmjs.com/package/perf-regexes\n[license-badge]: https://img.shields.io/npm/l/express.svg\n[license-url]: badge://github.com/aMarCruz/perf-regexes/blob/master/LICENSE\n[size-badge]: https://badgen.net/bundlephobia/min/perf-regexes\n[size-url]: https://bundlephobia.com/result?p=perf-regexes\n[kofi-url]: https://ko-fi.com/C0C7LF7I\n",
423 "maintainers": [
424 {
425 "name": "amarcruz",
426 "email": "[email protected]"
427 }
428 ],
429 "time": {
430 "modified": "2019-01-05T03:13:23.275Z",
431 "created": "2016-09-07T10:29:43.386Z",
432 "0.0.1": "2016-09-07T10:29:43.386Z",
433 "0.0.2": "2016-09-08T15:44:19.454Z",
434 "0.1.2": "2016-09-23T15:25:26.865Z",
435 "1.0.0": "2018-12-23T00:22:41.855Z",
436 "1.0.1": "2018-12-24T13:12:12.907Z"
437 },
438 "homepage": "https://github.com/aMarCruz/perf-regexes",
439 "keywords": [
440 "html",
441 "javascript",
442 "typescript",
443 "comments",
444 "regexp",
445 "regexes",
446 "search",
447 "match",
448 "source"
449 ],
450 "repository": {
451 "type": "git",
452 "url": "git+https://github.com/aMarCruz/perf-regexes.git"
453 },
454 "author": {
455 "name": "aMarCruz",
456 "email": "[email protected]",
457 "url": "https://github.com/aMarCruz"
458 },
459 "bugs": {
460 "url": "https://github.com/aMarCruz/perf-regexes/issues"
461 },
462 "license": "MIT",
463 "readmeFilename": "README.md"
464 }