1 | apemanmodule
|
2 | ==========
|
3 |
|
4 |
|
5 | This file is generated by ape-tmpl. Do not update manually.
|
6 | --->
|
7 |
|
8 |
|
9 | <a name="badges"></a>
|
10 |
|
11 | [![Build Status][bd_travis_shield_url]][bd_travis_url]
|
12 | [![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
|
13 | [![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
|
14 | [![npm Version][bd_npm_shield_url]][bd_npm_url]
|
15 |
|
16 | [bd_repo_url]: https://github.com/apeman-labo/apemanmodule
|
17 | [bd_travis_url]: http://travis-ci.org/apeman-labo/apemanmodule
|
18 | [bd_travis_shield_url]: http://img.shields.io/travis/apeman-labo/apemanmodule.svg?style=flat
|
19 | [bd_license_url]: https://github.com/apeman-labo/apemanmodule/blob/master/LICENSE
|
20 | [bd_codeclimate_url]: http://codeclimate.com/github/apeman-labo/apemanmodule
|
21 | [bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-labo/apemanmodule.svg?style=flat
|
22 | [bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-labo/apemanmodule.svg?style=flat
|
23 | [bd_gemnasium_url]: https://gemnasium.com/apeman-labo/apemanmodule
|
24 | [bd_gemnasium_shield_url]: https://gemnasium.com/apeman-labo/apemanmodule.svg
|
25 | [bd_npm_url]: http://www.npmjs.org/package/apemanmodule
|
26 | [bd_npm_shield_url]: http://img.shields.io/npm/v/apemanmodule.svg?style=flat
|
27 | [bd_bower_badge_url]: https://img.shields.io/bower/v/apemanmodule.svg?style=flat
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | <a name="description"></a>
|
34 |
|
35 | Directory module index for apeman.
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | <a name="overview"></a>
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | <a name="sections"></a>
|
50 |
|
51 |
|
52 |
|
53 | <a name="section-doc-guides-01-installation-md"></a>
|
54 | Installation
|
55 | -----
|
56 |
|
57 | ```bash
|
58 | $ npm install apemanmodule --save
|
59 | ```
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | <a name="section-doc-guides-02-usage-md"></a>
|
67 | Usage
|
68 | ---------
|
69 |
|
70 | apemanmodule dig in directory and exports found modules.
|
71 |
|
72 | ```javascript
|
73 | /**
|
74 | * This is an example index.js for a module directory.
|
75 | */
|
76 | "use strict";
|
77 |
|
78 | const apemanmodule = require('apemanmodule');
|
79 |
|
80 | let index = apemanmodule(__dirname, {
|
81 | /** Filename pattern to exports as pascal case name. **/
|
82 | pascal: '*_page.js',
|
83 | /** Throws error when module not found. */
|
84 | strict: true
|
85 | });
|
86 |
|
87 | // Print module settings.
|
88 | index.print();
|
89 |
|
90 | module.exports(index);
|
91 | ```
|
92 |
|
93 | Then, you can require exported modules like:
|
94 |
|
95 | ```javascript
|
96 | "use strict";
|
97 |
|
98 | const exampleIndex = require('../example');
|
99 |
|
100 | // Get modules defined example/index.js
|
101 | let FooPage = exampleIndex('FooPage'),
|
102 | barFunc = exampleIndex('barFunc');
|
103 |
|
104 | /*...*/
|
105 | ```
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | <a name="license"></a>
|
116 |
|
117 | License
|
118 | -------
|
119 | This software is released under the [MIT License](https://github.com/apeman-labo/apemanmodule/blob/master/LICENSE).
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 | <a name="links"></a>
|
126 |
|
127 | Links
|
128 | ------
|
129 |
|
130 | + [apeman](https://www.npmjs.com/package/apeman)
|
131 |
|
132 |
|