-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
133 lines (115 loc) · 5.09 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>cli.js - A library to craft modular, composable, and testable command line applications with Node.js</title>
<link rel="icon" type="image/png" href="/images/favicon.png">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/styles/index.css">
<link rel="stylesheet" href="/styles/ionicons.min.css">
<main role="main">
<header class="with-divider">
<nav class="main-nav">
<a href="/get-started">Get Started</a>
<a href="/docs">Docs</a>
<a href="/examples">Examples</a>
<a href="/plugins">Plugins</a>
<a href="https://github.com/clijs" target="_blank">Github</a>
</nav>
<a href="/"><img class="logo" src="/images/logo_7.svg" alt="Cli.js - Create composable, modular command line applications" /></a>
<br>
<br>
<h3>A library to craft modular, composable, and testable command line applications</h3>
</header>
<section class="with-divider">
<div class="code-container">
<h4><i class="icon ion-code"></i> Craft It</h4>
<div class="window">
<div class="window-header">
<div class="dots">
<span class="dot close"></span>
<span class="dot minimize"></span>
<span class="dot maximize"></span>
</div>
<div class="filename">~/www/my-cli-app/cmd.js</div>
</div>
<div class="window-body">
<!-- <pre><code class="javascript insert-code prettyprint"></code></pre> -->
<pre class="prettyprint lang-js linenums">var testCommand = command(
alias('test', 't'),
handler(function (context) {
console.log('Testing cli.js!')
})
)
var testFlag = flag(
alias('--test', '-h'),
handler(function (value, context) {
console.log('Flag value:', value)
})
)
run(
process.argv.slice(2),
app(
testCommand(),
testFlag()
)
)</pre>
</div>
</div>
</div>
<div class="terminal-container">
<h4><i class="icon ion-monitor"></i>Execute It</h4>
<div class="window">
<div class="window-header">
<div class="dots">
<span class="dot close"></span>
<span class="dot minimize"></span>
<span class="dot maximize"></span>
</div>
</div>
<div class="window-body">
<pre><code>~/www/cli-foo $: _</code></pre>
</div>
</div>
</div>
<div class="clear"></div>
</section>
<section class="why">
<h1>Why Cli.js? What's different?</h1>
<p>
There are already several <em>great</em> libraries on NPM that allow developers to create interactive and descriptive command line apps using Node.js (<a href="http://npmjs.com/package/yargs" target="_blank">Yargs</a>, <a href="http://npmjs.com/package/nash" target="_blank">Nash</a>, <a href="http://npmjs.com/package/commander" target="_blank">Commander</a>).
But, Cli.js's unique modular and composable api promotes small modules that just work, and work together. Everything is a function and everything composes.
</p>
<a href="/examples" class="btn">See Examples</a>
</section>
<section class="section descriptions">
<div>
<i class="icon ion-grid"></i>
<h2>Modular</h2>
<p>Everything is a function and in its own module. Use only what you need, reducing boot up time when executing large or small command line apps.</p>
</div>
<div>
<i class="icon ion-outlet"></i>
<h2>Composable</h2>
<!-- <p>Cli.js promotes creating smaller command line apps that compose together to create larger apps. Composability provides an obvious api, ensuring maintainability.</p> -->
<p>Write all your commands and flags as smaller, modular apps. Then compose them together to create your full command line app. Can you say plugins?! Woot!</p>
</div>
<div>
<i class="icon ion-erlenmeyer-flask"></i>
<h2>Testable</h2>
<p>Because modularity and pure functions are encouraged with Cli.js, it's easy to create isolated tests in order to boost confidence across your app releases.</p>
</div>
</section>
<section class="get-started with-divider">
<p>Getting that "I just need to write some code" feeling? Then, spend the next 2 minutes learning the api and writing your first composable and modular command line app!</p>
<a href="/get-started" class="btn">Get Started</a>
</section>
<footer>
Released under the <a href="http://opensource.org/licenses/MIT" target="_blank">MIT</a> license. <br>
Run by <a href="https://github.com/clijs" target="_blank">Contributors</a>.
</footer>
</main>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<script src="/index.js"></script>
</html>