Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

commentt program header

  • Loading branch information...
commit 5ed096815546f8a8cd7622a2c64bfcb895cbaf71 1 parent ac211ef
@logicalparadox authored
Showing with 49 additions and 2 deletions.
  1. +28 −2 docs/out/index.html
  2. +21 −0 lib/electron/program.js
View
30 docs/out/index.html
@@ -153,7 +153,32 @@
</div>
<ul class="tags">
</ul>
- <div class="description"></div>
+ <div class="description"><p>The primary export of the electron module is a function
+that composes a new program framework. The returned
+<code>program</code> is a chainable api that allow you to change
+settings, define commands, and start launch the program.
+
+</p>
+<p>The primary argument provided on construction is the base
+name used through the help documentation. In a majority of
+of cases, this would be the command executed from your terminal
+used launch the program.
+
+</p>
+<p>In the case of scripts with the header of <code>#!/usr/bin/env node</code>,
+you should use a variant of the following.
+
+</p>
+<pre><code><span class="keyword">var</span> program = electron(<span class="string">'microscope'</span>);</code></pre>
+<p>If you are however launching your program from a <code>.js</code> file,
+the recommended construction pattern is the following.
+
+</p>
+<pre><code><span class="keyword">var</span> program = electrong(<span class="string">'node microscope.js'</span>);</code></pre>
+<p>You can then chain any of the following commands to further
+define your application and commands.
+</p>
+</div>
</div>
<div id="program_framework-command" class="segment">
<div class="summary"><h3>.command (name)</h3>
@@ -415,7 +440,8 @@
no string changes will be made.
</p>
-<pre><code>console.log(<span class="string">'hello universe'</span>.green);</code></pre>
+<pre><code>program.colorize();
+console.log(<span class="string">'hello universe'</span>.green);</code></pre>
<h5>Colors</h5>
<ul>
<li>red</li>
View
21 lib/electron/program.js
@@ -56,7 +56,28 @@ module.exports = Program;
/**
* ## Program Framework
*
+ * The primary export of the electron module is a function
+ * that composes a new program framework. The returned
+ * `program` is a chainable api that allow you to change
+ * settings, define commands, and start launch the program.
*
+ * The primary argument provided on construction is the base
+ * name used through the help documentation. In a majority of
+ * of cases, this would be the command executed from your terminal
+ * used launch the program.
+ *
+ * In the case of scripts with the header of `#!/usr/bin/env node`,
+ * you should use a variant of the following.
+ *
+ * var program = electron('microscope');
+ *
+ * If you are however launching your program from a `.js` file,
+ * the recommended construction pattern is the following.
+ *
+ * var program = electrong('node microscope.js');
+ *
+ * You can then chain any of the following commands to further
+ * define your application and commands.
*
* @header Program Framework
*/

0 comments on commit 5ed0968

Please sign in to comment.
Something went wrong with that request. Please try again.