1 | apeman-commons-invocating
|
2 | ===========
|
3 |
|
4 |
|
5 | [![Build Status][my_travis_badge_url]][my_travis_url]
|
6 | [![Code Climate][my_codeclimate_badge_url]][my_codeclimate_url]
|
7 | [![Code Coverage][my_codeclimate_coverage_badge_url]][my_codeclimate_url]
|
8 | [![npm version][my_npm_budge_url]][my_npm_url]
|
9 |
|
10 | apeman common module for invocating.
|
11 |
|
12 |
|
13 | Installation
|
14 | ------------
|
15 |
|
16 | Install module via [npm][npm_url].
|
17 |
|
18 | ```bash
|
19 | # Install as local module.
|
20 | $ npm install apeman-commons-invocating --save
|
21 | ```
|
22 |
|
23 | Usage
|
24 | -----
|
25 |
|
26 | ### Context
|
27 |
|
28 | Context constructor.
|
29 |
|
30 | ```javascript
|
31 | /**
|
32 | * This is example file for context.
|
33 | */
|
34 |
|
35 | "use strict";
|
36 |
|
37 | var Context = require('apeman-invocating/lib/context'),
|
38 | context = new Context({
|
39 | foo: 'bar'
|
40 | });
|
41 |
|
42 | console.log(context.foo); // => 'bar'
|
43 |
|
44 |
|
45 | ```
|
46 | ### Module loader
|
47 |
|
48 | Load a module from given path.
|
49 |
|
50 | ```javascript
|
51 | /**
|
52 | * This an example for module loader.
|
53 | */
|
54 |
|
55 | "use strict";
|
56 |
|
57 | var ModuleLoader = require('apeman-invocating/lib/module_loader');
|
58 |
|
59 | var loader = new ModuleLoader({
|
60 | // Base directory to search
|
61 | basedir: process.cwd()
|
62 | });
|
63 | loader.load('my-awesome-module.', function (err, module) {
|
64 | if (err) {
|
65 | // Error will be passed unless module found.
|
66 | /*...*/
|
67 | } else {
|
68 | /** ...*/
|
69 | }
|
70 | });
|
71 |
|
72 | ```
|
73 |
|
74 | License
|
75 | -------
|
76 |
|
77 | This software is released under the [MIT License][my_license_url].
|
78 |
|
79 |
|
80 | Links
|
81 | -----
|
82 |
|
83 | + [apeman][apeman_url]
|
84 |
|
85 | [npm_url]: https://www.npmjs.com/
|
86 | [apeman_url]: https://github.com/apeman-repo/apeman
|
87 | [my_repo_url]: https://github.com/apeman-repo/apeman-commons-invocating
|
88 | [my_travis_url]: http://travis-ci.org/apeman-repo/apeman-commons-invocating
|
89 | [my_travis_badge_url]: http://img.shields.io/travis/apeman-repo/apeman-commons-invocating.svg?style=flat
|
90 | [my_license_url]: https://github.com/apeman-repo/apeman-commons-invocating/blob/master/LICENSE
|
91 | [my_codeclimate_url]: http://codeclimate.com/github/apeman-repo/apeman-commons-invocating
|
92 | [my_codeclimate_badge_url]: http://img.shields.io/codeclimate/github/apeman-repo/apeman-commons-invocating.svg?style=flat
|
93 | [my_codeclimate_coverage_badge_url]: http://img.shields.io/codeclimate/coverage/github/apeman-repo/apeman-commons-invocating.svg?style=flat
|
94 | [my_npm_url]: http://www.npmjs.org/package/apeman-commons-invocating
|
95 | [my_npm_budge_url]: http://img.shields.io/npm/v/apeman-commons-invocating.svg?style=flat |
\ | No newline at end of file |