UNPKG

3.12 kBMarkdownView Raw
1apemanmodule
2==========
3
4<!---
5This file is generated by ape-tmpl. Do not update manually.
6--->
7
8<!-- Badge Start -->
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<!-- Badge End -->
30
31
32<!-- Description Start -->
33<a name="description"></a>
34
35Directory module index for apeman.
36
37<!-- Description End -->
38
39
40<!-- Overview Start -->
41<a name="overview"></a>
42
43
44
45<!-- Overview End -->
46
47
48<!-- Sections Start -->
49<a name="sections"></a>
50
51<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
52
53<a name="section-doc-guides-01-installation-md"></a>
54Installation
55-----
56
57```bash
58$ npm install apemanmodule --save
59```
60
61
62<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
63
64<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->
65
66<a name="section-doc-guides-02-usage-md"></a>
67Usage
68---------
69
70apemanmodule 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
78const apemanmodule = require('apemanmodule');
79
80let 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.
88index.print();
89
90module.exports(index);
91```
92
93Then, you can require exported modules like:
94
95```javascript
96"use strict";
97
98const exampleIndex = require('../example');
99
100// Get modules defined example/index.js
101let FooPage = exampleIndex('FooPage'),
102 barFunc = exampleIndex('barFunc');
103
104/*...*/
105```
106
107
108<!-- Section from "doc/guides/02.Usage.md.hbs" End -->
109
110
111<!-- Sections Start -->
112
113
114<!-- LICENSE Start -->
115<a name="license"></a>
116
117License
118-------
119This software is released under the [MIT License](https://github.com/apeman-labo/apemanmodule/blob/master/LICENSE).
120
121<!-- LICENSE End -->
122
123
124<!-- Links Start -->
125<a name="links"></a>
126
127Links
128------
129
130+ [apeman](https://www.npmjs.com/package/apeman)
131
132<!-- Links End -->