Debian Codegraph @

workspaces/arborist/test/fixtures/registry-mocks/content/require-directory.json

raw
1 {
2 "_id": "require-directory",
3 "_rev": "61-948fafe1a2982f83d074de81e0f9e1b7",
4 "name": "require-directory",
5 "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
6 "dist-tags": {
7 "latest": "2.1.1"
8 },
9 "versions": {
10 "0.0.1": {
11 "author": {
12 "name": "Troy Goode",
13 "email": "[email protected]",
14 "url": "http://github.com/troygoode/"
15 },
16 "name": "require-directory",
17 "version": "0.0.1",
18 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
19 "keywords": [
20 "require",
21 "directory",
22 "library",
23 "recursive"
24 ],
25 "homepage": "https://github.com/troygoode/node-require-directory/",
26 "main": "index.js",
27 "repository": {
28 "type": "git",
29 "url": "git://github.com/troygoode/node-require-directory.git"
30 },
31 "contributors": [
32 {
33 "name": "Troy Goode",
34 "email": "[email protected]",
35 "url": "http://github.com/troygoode/"
36 }
37 ],
38 "licenses": [
39 {
40 "type": "MIT",
41 "url": "http://www.opensource.org/licenses/mit-license.php"
42 }
43 ],
44 "bugs": {
45 "url": "http://github.com/troygoode/node-require-directory/issues/"
46 },
47 "engines": {
48 "node": ">=0.6.0"
49 },
50 "dependencies": {},
51 "devDependencies": {},
52 "scripts": {},
53 "bin": {},
54 "_npmUser": {
55 "name": "troygoode",
56 "email": "[email protected]"
57 },
58 "_id": "[email protected]",
59 "_engineSupported": true,
60 "_npmVersion": "1.0.106",
61 "_nodeVersion": "v0.6.6",
62 "_defaultsLoaded": true,
63 "dist": {
64 "shasum": "db2dd671d72cfbc13d99e33cf2cc7de942e4cb4b",
65 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-0.0.1.tgz"
66 },
67 "maintainers": [
68 {
69 "name": "troygoode",
70 "email": "[email protected]"
71 }
72 ],
73 "directories": {}
74 },
75 "0.0.2": {
76 "author": {
77 "name": "Troy Goode",
78 "email": "[email protected]",
79 "url": "http://github.com/troygoode/"
80 },
81 "name": "require-directory",
82 "version": "0.0.2",
83 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
84 "keywords": [
85 "require",
86 "directory",
87 "library",
88 "recursive"
89 ],
90 "homepage": "https://github.com/troygoode/node-require-directory/",
91 "main": "index.js",
92 "repository": {
93 "type": "git",
94 "url": "git://github.com/troygoode/node-require-directory.git"
95 },
96 "contributors": [
97 {
98 "name": "Troy Goode",
99 "email": "[email protected]",
100 "url": "http://github.com/troygoode/"
101 }
102 ],
103 "licenses": [
104 {
105 "type": "MIT",
106 "url": "http://www.opensource.org/licenses/mit-license.php"
107 }
108 ],
109 "bugs": {
110 "url": "http://github.com/troygoode/node-require-directory/issues/"
111 },
112 "engines": {
113 "node": ">=0.6.0"
114 },
115 "dependencies": {},
116 "devDependencies": {},
117 "scripts": {},
118 "bin": {},
119 "_id": "[email protected]",
120 "dist": {
121 "shasum": "86f04926d03b50a5bf3143ea23701888d9e8b3e4",
122 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-0.0.2.tgz"
123 },
124 "_npmVersion": "1.1.66",
125 "_npmUser": {
126 "name": "troygoode",
127 "email": "[email protected]"
128 },
129 "maintainers": [
130 {
131 "name": "troygoode",
132 "email": "[email protected]"
133 }
134 ],
135 "directories": {}
136 },
137 "0.0.3": {
138 "author": {
139 "name": "Troy Goode",
140 "email": "[email protected]",
141 "url": "http://github.com/troygoode/"
142 },
143 "name": "require-directory",
144 "version": "0.0.3",
145 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
146 "keywords": [
147 "require",
148 "directory",
149 "library",
150 "recursive"
151 ],
152 "homepage": "https://github.com/troygoode/node-require-directory/",
153 "main": "index.js",
154 "repository": {
155 "type": "git",
156 "url": "git://github.com/troygoode/node-require-directory.git"
157 },
158 "contributors": [
159 {
160 "name": "Troy Goode",
161 "email": "[email protected]",
162 "url": "http://github.com/troygoode/"
163 }
164 ],
165 "licenses": [
166 {
167 "type": "MIT",
168 "url": "http://www.opensource.org/licenses/mit-license.php"
169 }
170 ],
171 "bugs": {
172 "url": "http://github.com/troygoode/node-require-directory/issues/"
173 },
174 "engines": {
175 "node": ">=0.6.0"
176 },
177 "dependencies": {},
178 "devDependencies": {
179 "mocha": "latest"
180 },
181 "scripts": {
182 "test": "./node_modules/mocha/bin/mocha"
183 },
184 "bin": {},
185 "_id": "[email protected]",
186 "dist": {
187 "shasum": "d36fcc775f7595e79d7f904ff01b112b2d9c2b69",
188 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-0.0.3.tgz"
189 },
190 "_npmVersion": "1.1.66",
191 "_npmUser": {
192 "name": "troygoode",
193 "email": "[email protected]"
194 },
195 "maintainers": [
196 {
197 "name": "troygoode",
198 "email": "[email protected]"
199 }
200 ],
201 "directories": {}
202 },
203 "1.0.0": {
204 "author": {
205 "name": "Troy Goode",
206 "email": "[email protected]",
207 "url": "http://github.com/troygoode/"
208 },
209 "name": "require-directory",
210 "version": "1.0.0",
211 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
212 "keywords": [
213 "require",
214 "directory",
215 "library",
216 "recursive"
217 ],
218 "homepage": "https://github.com/troygoode/node-require-directory/",
219 "main": "index.js",
220 "repository": {
221 "type": "git",
222 "url": "git://github.com/troygoode/node-require-directory.git"
223 },
224 "contributors": [
225 {
226 "name": "Troy Goode",
227 "email": "[email protected]",
228 "url": "http://github.com/troygoode/"
229 }
230 ],
231 "licenses": [
232 {
233 "type": "MIT",
234 "url": "http://www.opensource.org/licenses/mit-license.php"
235 }
236 ],
237 "bugs": {
238 "url": "http://github.com/troygoode/node-require-directory/issues/"
239 },
240 "engines": {
241 "node": ">=0.6.0"
242 },
243 "dependencies": {},
244 "devDependencies": {
245 "mocha": "latest"
246 },
247 "scripts": {
248 "test": "./node_modules/mocha/bin/mocha"
249 },
250 "bin": {},
251 "_id": "[email protected]",
252 "dist": {
253 "shasum": "3b53b180a92ed52869a50fecddf5d962bb04e951",
254 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.0.0.tgz"
255 },
256 "_npmVersion": "1.1.59",
257 "_npmUser": {
258 "name": "troygoode",
259 "email": "[email protected]"
260 },
261 "maintainers": [
262 {
263 "name": "troygoode",
264 "email": "[email protected]"
265 }
266 ],
267 "directories": {}
268 },
269 "1.0.1": {
270 "author": {
271 "name": "Troy Goode",
272 "email": "[email protected]",
273 "url": "http://github.com/troygoode/"
274 },
275 "name": "require-directory",
276 "version": "1.0.1",
277 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
278 "keywords": [
279 "require",
280 "directory",
281 "library",
282 "recursive"
283 ],
284 "homepage": "https://github.com/troygoode/node-require-directory/",
285 "main": "index.js",
286 "repository": {
287 "type": "git",
288 "url": "git://github.com/troygoode/node-require-directory.git"
289 },
290 "contributors": [
291 {
292 "name": "Troy Goode",
293 "email": "[email protected]",
294 "url": "http://github.com/troygoode/"
295 }
296 ],
297 "licenses": [
298 {
299 "type": "MIT",
300 "url": "http://www.opensource.org/licenses/mit-license.php"
301 }
302 ],
303 "bugs": {
304 "url": "http://github.com/troygoode/node-require-directory/issues/"
305 },
306 "engines": {
307 "node": ">=0.6.0"
308 },
309 "dependencies": {},
310 "devDependencies": {
311 "mocha": "latest"
312 },
313 "scripts": {
314 "test": "./node_modules/mocha/bin/mocha"
315 },
316 "bin": {},
317 "_id": "[email protected]",
318 "dist": {
319 "shasum": "19c41dac1aeacdc274801ba24166aadde7af4823",
320 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.0.1.tgz"
321 },
322 "_from": ".",
323 "_npmVersion": "1.2.18",
324 "_npmUser": {
325 "name": "troygoode",
326 "email": "[email protected]"
327 },
328 "maintainers": [
329 {
330 "name": "troygoode",
331 "email": "[email protected]"
332 }
333 ],
334 "directories": {}
335 },
336 "1.0.2": {
337 "author": {
338 "name": "Troy Goode",
339 "email": "[email protected]",
340 "url": "http://github.com/troygoode/"
341 },
342 "name": "require-directory",
343 "version": "1.0.2",
344 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
345 "keywords": [
346 "require",
347 "directory",
348 "library",
349 "recursive"
350 ],
351 "homepage": "https://github.com/troygoode/node-require-directory/",
352 "main": "index.js",
353 "repository": {
354 "type": "git",
355 "url": "git://github.com/troygoode/node-require-directory.git"
356 },
357 "contributors": [
358 {
359 "name": "Troy Goode",
360 "email": "[email protected]",
361 "url": "http://github.com/troygoode/"
362 }
363 ],
364 "licenses": [
365 {
366 "type": "MIT",
367 "url": "http://www.opensource.org/licenses/mit-license.php"
368 }
369 ],
370 "bugs": {
371 "url": "http://github.com/troygoode/node-require-directory/issues/"
372 },
373 "engines": {
374 "node": ">=0.6.0"
375 },
376 "dependencies": {},
377 "devDependencies": {
378 "mocha": "latest"
379 },
380 "scripts": {
381 "test": "./node_modules/mocha/bin/mocha"
382 },
383 "bin": {},
384 "_id": "[email protected]",
385 "dist": {
386 "shasum": "3c150e9fbbc6b6d634b65a0cecd89b6f8a9bd5d8",
387 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.0.2.tgz"
388 },
389 "_from": ".",
390 "_npmVersion": "1.2.18",
391 "_npmUser": {
392 "name": "troygoode",
393 "email": "[email protected]"
394 },
395 "maintainers": [
396 {
397 "name": "troygoode",
398 "email": "[email protected]"
399 }
400 ],
401 "directories": {}
402 },
403 "1.1.0": {
404 "author": {
405 "name": "Troy Goode",
406 "email": "[email protected]",
407 "url": "http://github.com/troygoode/"
408 },
409 "name": "require-directory",
410 "version": "1.1.0",
411 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
412 "keywords": [
413 "require",
414 "directory",
415 "library",
416 "recursive"
417 ],
418 "homepage": "https://github.com/troygoode/node-require-directory/",
419 "main": "index.js",
420 "repository": {
421 "type": "git",
422 "url": "git://github.com/troygoode/node-require-directory.git"
423 },
424 "contributors": [
425 {
426 "name": "Troy Goode",
427 "email": "[email protected]",
428 "url": "http://github.com/troygoode/"
429 }
430 ],
431 "licenses": [
432 {
433 "type": "MIT",
434 "url": "http://www.opensource.org/licenses/mit-license.php"
435 }
436 ],
437 "bugs": {
438 "url": "http://github.com/troygoode/node-require-directory/issues/"
439 },
440 "engines": {
441 "node": ">=0.6.0"
442 },
443 "dependencies": {},
444 "devDependencies": {
445 "mocha": "latest"
446 },
447 "scripts": {
448 "test": "./node_modules/mocha/bin/mocha"
449 },
450 "bin": {},
451 "_id": "[email protected]",
452 "dist": {
453 "shasum": "70bb3fe783c44b24a49eae3ef23420d54ea3484c",
454 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.1.0.tgz"
455 },
456 "_from": ".",
457 "_npmVersion": "1.2.18",
458 "_npmUser": {
459 "name": "troygoode",
460 "email": "[email protected]"
461 },
462 "maintainers": [
463 {
464 "name": "troygoode",
465 "email": "[email protected]"
466 }
467 ],
468 "directories": {}
469 },
470 "1.1.1": {
471 "author": {
472 "name": "Troy Goode",
473 "email": "[email protected]",
474 "url": "http://github.com/troygoode/"
475 },
476 "name": "require-directory",
477 "version": "1.1.1",
478 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
479 "keywords": [
480 "require",
481 "directory",
482 "library",
483 "recursive"
484 ],
485 "homepage": "https://github.com/troygoode/node-require-directory/",
486 "main": "index.js",
487 "repository": {
488 "type": "git",
489 "url": "git://github.com/troygoode/node-require-directory.git"
490 },
491 "contributors": [
492 {
493 "name": "Troy Goode",
494 "email": "[email protected]",
495 "url": "http://github.com/troygoode/"
496 }
497 ],
498 "licenses": [
499 {
500 "type": "MIT",
501 "url": "http://www.opensource.org/licenses/mit-license.php"
502 }
503 ],
504 "bugs": {
505 "url": "http://github.com/troygoode/node-require-directory/issues/"
506 },
507 "engines": {
508 "node": ">=0.6.0"
509 },
510 "dependencies": {},
511 "devDependencies": {
512 "mocha": "latest"
513 },
514 "scripts": {
515 "test": "./node_modules/mocha/bin/mocha"
516 },
517 "bin": {},
518 "_id": "[email protected]",
519 "dist": {
520 "shasum": "43b23b76d00ce37ed1787af33dd36d78103efdcd",
521 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.1.1.tgz"
522 },
523 "_from": ".",
524 "_npmVersion": "1.3.8",
525 "_npmUser": {
526 "name": "troygoode",
527 "email": "[email protected]"
528 },
529 "maintainers": [
530 {
531 "name": "troygoode",
532 "email": "[email protected]"
533 }
534 ],
535 "directories": {}
536 },
537 "1.2.0": {
538 "author": {
539 "name": "Troy Goode",
540 "email": "[email protected]",
541 "url": "http://github.com/troygoode/"
542 },
543 "name": "require-directory",
544 "version": "1.2.0",
545 "description": "Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.",
546 "keywords": [
547 "require",
548 "directory",
549 "library",
550 "recursive"
551 ],
552 "homepage": "https://github.com/troygoode/node-require-directory/",
553 "main": "index.js",
554 "repository": {
555 "type": "git",
556 "url": "git://github.com/troygoode/node-require-directory.git"
557 },
558 "contributors": [
559 {
560 "name": "Troy Goode",
561 "email": "[email protected]",
562 "url": "http://github.com/troygoode/"
563 }
564 ],
565 "licenses": [
566 {
567 "type": "MIT",
568 "url": "http://www.opensource.org/licenses/mit-license.php"
569 }
570 ],
571 "bugs": {
572 "url": "http://github.com/troygoode/node-require-directory/issues/"
573 },
574 "engines": {
575 "node": ">=0.6.0"
576 },
577 "dependencies": {},
578 "devDependencies": {
579 "mocha": "latest"
580 },
581 "scripts": {
582 "test": "./node_modules/mocha/bin/mocha"
583 },
584 "bin": {},
585 "_id": "[email protected]",
586 "dist": {
587 "shasum": "35ff45a82ab73ca6ca35c746c0a17014371e1afd",
588 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-1.2.0.tgz"
589 },
590 "_from": ".",
591 "_npmVersion": "1.3.11",
592 "_npmUser": {
593 "name": "troygoode",
594 "email": "[email protected]"
595 },
596 "maintainers": [
597 {
598 "name": "troygoode",
599 "email": "[email protected]"
600 }
601 ],
602 "directories": {}
603 },
604 "2.0.0": {
605 "author": {
606 "name": "Troy Goode",
607 "email": "[email protected]",
608 "url": "http://github.com/troygoode/"
609 },
610 "name": "require-directory",
611 "version": "2.0.0",
612 "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
613 "keywords": [
614 "require",
615 "directory",
616 "library",
617 "recursive"
618 ],
619 "homepage": "https://github.com/troygoode/node-require-directory/",
620 "main": "index.js",
621 "repository": {
622 "type": "git",
623 "url": "git://github.com/troygoode/node-require-directory.git"
624 },
625 "contributors": [
626 {
627 "name": "Troy Goode",
628 "email": "[email protected]",
629 "url": "http://github.com/troygoode/"
630 }
631 ],
632 "licenses": [
633 {
634 "type": "MIT",
635 "url": "http://www.opensource.org/licenses/mit-license.php"
636 }
637 ],
638 "bugs": {
639 "url": "http://github.com/troygoode/node-require-directory/issues/"
640 },
641 "engines": {
642 "node": ">=0.10.0"
643 },
644 "dependencies": {
645 "underscore": "^1.6.0"
646 },
647 "devDependencies": {
648 "jshint": "^2.5.2",
649 "mocha": "^1.21.3"
650 },
651 "scripts": {
652 "test": "mocha",
653 "lint": "jshint index.js test/test.js"
654 },
655 "gitHead": "ee51f6f6b1e75d7d16ff5195561b5b0f30027a38",
656 "_id": "[email protected]",
657 "_shasum": "22442c7c5a675cf70402cddb29518e5edd3427d9",
658 "_from": ".",
659 "_npmVersion": "1.5.0-alpha-1",
660 "_npmUser": {
661 "name": "troygoode",
662 "email": "[email protected]"
663 },
664 "maintainers": [
665 {
666 "name": "troygoode",
667 "email": "[email protected]"
668 }
669 ],
670 "dist": {
671 "shasum": "22442c7c5a675cf70402cddb29518e5edd3427d9",
672 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-2.0.0.tgz"
673 },
674 "directories": {}
675 },
676 "2.1.0": {
677 "author": {
678 "name": "Troy Goode",
679 "email": "[email protected]",
680 "url": "http://github.com/troygoode/"
681 },
682 "name": "require-directory",
683 "version": "2.1.0",
684 "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
685 "keywords": [
686 "require",
687 "directory",
688 "library",
689 "recursive"
690 ],
691 "homepage": "https://github.com/troygoode/node-require-directory/",
692 "main": "index.js",
693 "repository": {
694 "type": "git",
695 "url": "git://github.com/troygoode/node-require-directory.git"
696 },
697 "contributors": [
698 {
699 "name": "Troy Goode",
700 "email": "[email protected]",
701 "url": "http://github.com/troygoode/"
702 }
703 ],
704 "licenses": [
705 {
706 "type": "MIT",
707 "url": "http://www.opensource.org/licenses/mit-license.php"
708 }
709 ],
710 "bugs": {
711 "url": "http://github.com/troygoode/node-require-directory/issues/"
712 },
713 "engines": {
714 "node": ">=0.10.0"
715 },
716 "devDependencies": {
717 "jshint": "^2.6.0",
718 "mocha": "^2.1.0"
719 },
720 "scripts": {
721 "test": "mocha",
722 "lint": "jshint index.js test/test.js"
723 },
724 "gitHead": "08f75bb9e14aa33834519c4788c5618e318925db",
725 "_id": "[email protected]",
726 "_shasum": "707ab5d99b3e819ccf3f2bc77195bdcea0f0e61b",
727 "_from": ".",
728 "_npmVersion": "2.5.1",
729 "_nodeVersion": "0.12.0",
730 "_npmUser": {
731 "name": "troygoode",
732 "email": "[email protected]"
733 },
734 "maintainers": [
735 {
736 "name": "troygoode",
737 "email": "[email protected]"
738 }
739 ],
740 "dist": {
741 "shasum": "707ab5d99b3e819ccf3f2bc77195bdcea0f0e61b",
742 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.0.tgz"
743 },
744 "directories": {}
745 },
746 "2.1.1": {
747 "author": {
748 "name": "Troy Goode",
749 "email": "[email protected]",
750 "url": "http://github.com/troygoode/"
751 },
752 "name": "require-directory",
753 "version": "2.1.1",
754 "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
755 "keywords": [
756 "require",
757 "directory",
758 "library",
759 "recursive"
760 ],
761 "homepage": "https://github.com/troygoode/node-require-directory/",
762 "main": "index.js",
763 "repository": {
764 "type": "git",
765 "url": "git://github.com/troygoode/node-require-directory.git"
766 },
767 "contributors": [
768 {
769 "name": "Troy Goode",
770 "email": "[email protected]",
771 "url": "http://github.com/troygoode/"
772 }
773 ],
774 "license": "MIT",
775 "bugs": {
776 "url": "http://github.com/troygoode/node-require-directory/issues/"
777 },
778 "engines": {
779 "node": ">=0.10.0"
780 },
781 "devDependencies": {
782 "jshint": "^2.6.0",
783 "mocha": "^2.1.0"
784 },
785 "scripts": {
786 "test": "mocha",
787 "lint": "jshint index.js test/test.js"
788 },
789 "gitHead": "cc71c23dd0c16cefd26855303c16ca1b9b50a36d",
790 "_id": "[email protected]",
791 "_shasum": "8c64ad5fd30dab1c976e2344ffe7f792a6a6df42",
792 "_from": ".",
793 "_npmVersion": "2.5.1",
794 "_nodeVersion": "0.12.0",
795 "_npmUser": {
796 "name": "troygoode",
797 "email": "[email protected]"
798 },
799 "maintainers": [
800 {
801 "name": "troygoode",
802 "email": "[email protected]"
803 }
804 ],
805 "dist": {
806 "shasum": "8c64ad5fd30dab1c976e2344ffe7f792a6a6df42",
807 "tarball": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
808 },
809 "directories": {}
810 }
811 },
812 "readme": "# require-directory\n\nRecursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules.\n\n**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)**\n\n[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/)\n\n[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory)\n\n## How To Use\n\n### Installation (via [npm](https://npmjs.org/package/require-directory))\n\n```bash\n$ npm install require-directory\n```\n\n### Usage\n\nA common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so:\n\n* app.js\n* routes/\n * index.js\n * home.js\n * auth/\n * login.js\n * logout.js\n * register.js\n\n`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so:\n\n```javascript\nvar requireDirectory = require('require-directory');\nmodule.exports = requireDirectory(module);\n```\n\n`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory:\n\n```javascript\nvar routes = require('./routes');\n\n// snip\n\napp.get('/', routes.home);\napp.get('/register', routes.auth.register);\napp.get('/login', routes.auth.login);\napp.get('/logout', routes.auth.logout);\n```\n\nThe `routes` variable above is the equivalent of this:\n\n```javascript\nvar routes = {\n home: require('routes/home.js'),\n auth: {\n login: require('routes/auth/login.js'),\n logout: require('routes/auth/logout.js'),\n register: require('routes/auth/register.js')\n }\n};\n```\n\n*Note that `routes.index` will be `undefined` as you would hope.*\n\n### Specifying Another Directory\n\nYou can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`:\n\n```javascript\nvar requireDirectory = require('require-directory');\nmodule.exports = requireDirectory(module, './some/subdirectory');\n```\n\nFor example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to:\n\n```javascript\nvar requireDirectory = require('require-directory');\nvar routes = requireDirectory(module, './routes');\n```\n\n## Options\n\nYou can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options:\n\n### Whitelisting\n\nWhitelisting (either via RegExp or function) allows you to specify that only certain files be loaded.\n\n```javascript\nvar requireDirectory = require('require-directory'),\n whitelist = /onlyinclude.js$/,\n hash = requireDirectory(module, {include: whitelist});\n```\n\n```javascript\nvar requireDirectory = require('require-directory'),\n check = function(path){\n if(/onlyinclude.js$/.test(path)){\n return true; // don't include\n }else{\n return false; // go ahead and include\n }\n },\n hash = requireDirectory(module, {include: check});\n```\n\n### Blacklisting\n\nBlacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded.\n\n```javascript\nvar requireDirectory = require('require-directory'),\n blacklist = /dontinclude\\.js$/,\n hash = requireDirectory(module, {exclude: blacklist});\n```\n\n```javascript\nvar requireDirectory = require('require-directory'),\n check = function(path){\n if(/dontinclude\\.js$/.test(path)){\n return false; // don't include\n }else{\n return true; // go ahead and include\n }\n },\n hash = requireDirectory(module, {exclude: check});\n```\n\n### Visiting Objects As They're Loaded\n\n`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports.\n\n```javascript\nvar requireDirectory = require('require-directory'),\n visitor = function(obj) {\n console.log(obj); // will be called for every module that is loaded\n },\n hash = requireDirectory(module, {visit: visitor});\n```\n\nThe visitor can also transform the objects by returning a value:\n\n```javascript\nvar requireDirectory = require('require-directory'),\n visitor = function(obj) {\n return obj(new Date());\n },\n hash = requireDirectory(module, {visit: visitor});\n```\n\n### Renaming Keys\n\n```javascript\nvar requireDirectory = require('require-directory'),\n renamer = function(name) {\n return name.toUpperCase();\n },\n hash = requireDirectory(module, {rename: renamer});\n```\n\n### No Recursion\n\n```javascript\nvar requireDirectory = require('require-directory'),\n hash = requireDirectory(module, {recurse: false});\n```\n\n## Run Unit Tests\n\n```bash\n$ npm run lint\n$ npm test\n```\n\n## License\n\n[MIT License](http://www.opensource.org/licenses/mit-license.php)\n\n## Author\n\n[Troy Goode](https://github.com/TroyGoode) ([[email protected]](mailto:[email protected]))\n\n",
813 "maintainers": [
814 {
815 "name": "troygoode",
816 "email": "[email protected]"
817 }
818 ],
819 "time": {
820 "modified": "2018-08-03T00:39:55.133Z",
821 "created": "2011-12-27T00:06:30.661Z",
822 "0.0.1": "2011-12-27T00:06:32.027Z",
823 "0.0.2": "2012-12-12T15:17:08.227Z",
824 "0.0.3": "2012-12-12T21:23:28.294Z",
825 "1.0.0": "2012-12-16T16:30:54.518Z",
826 "1.0.1": "2013-06-23T20:54:08.357Z",
827 "1.0.2": "2013-06-23T21:15:20.814Z",
828 "1.1.0": "2013-08-28T20:32:19.471Z",
829 "1.1.1": "2013-09-01T15:10:33.473Z",
830 "1.2.0": "2013-11-14T13:59:26.636Z",
831 "2.0.0": "2014-07-29T02:17:35.323Z",
832 "2.1.0": "2015-02-19T05:02:34.997Z",
833 "2.1.1": "2015-05-28T08:31:04.702Z"
834 },
835 "author": {
836 "name": "Troy Goode",
837 "email": "[email protected]",
838 "url": "http://github.com/troygoode/"
839 },
840 "repository": {
841 "type": "git",
842 "url": "git://github.com/troygoode/node-require-directory.git"
843 },
844 "users": {
845 "troygoode": true,
846 "dgarlitt": true,
847 "filipedeschamps": true,
848 "symblst": true,
849 "metinweb": true,
850 "highflying": true,
851 "nukisman": true,
852 "chaseadamsio": true,
853 "skrdv": true,
854 "mgenev": true,
855 "koulmomo": true,
856 "wangnan0610": true,
857 "ufukomer": true,
858 "nelix": true,
859 "mode54": true,
860 "nmccready": true,
861 "icerainnuaa": true,
862 "sopepos": true,
863 "tmurngon": true,
864 "mojaray2k": true,
865 "paulnordlund": true,
866 "shanemileham": true,
867 "fengbeijing": true,
868 "suddi": true,
869 "mariusc23": true,
870 "bvaccc": true,
871 "eonio": true,
872 "tomgao365": true,
873 "xanderlewis": true,
874 "gamersdelight": true,
875 "shlomi": true,
876 "akamaozu": true,
877 "losymear": true,
878 "likkli": true,
879 "dwqs": true
880 },
881 "homepage": "https://github.com/troygoode/node-require-directory/",
882 "keywords": [
883 "require",
884 "directory",
885 "library",
886 "recursive"
887 ],
888 "contributors": [
889 {
890 "name": "Troy Goode",
891 "email": "[email protected]",
892 "url": "http://github.com/troygoode/"
893 }
894 ],
895 "bugs": {
896 "url": "http://github.com/troygoode/node-require-directory/issues/"
897 },
898 "readmeFilename": "README.markdown",
899 "license": "MIT",
900 "_attachments": {}
901 }