Skip to content

Commit 50e841d

Browse files
committed
Add README
1 parent 44ba2f3 commit 50e841d

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# REPL
2+
3+
> REPL environment.
4+
5+
6+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
7+
8+
<section class="intro">
9+
10+
</section>
11+
12+
<!-- /.intro -->
13+
14+
<!-- Package usage documentation. -->
15+
16+
<section class="usage">
17+
18+
## Usage
19+
20+
``` javascript
21+
var repl = require( '@stdlib/repl' );
22+
```
23+
24+
#### repl( \[options\], clbk )
25+
26+
Starts a REPL environment.
27+
28+
``` javascript
29+
repl( onStart );
30+
31+
function onStart( error, r ) {
32+
if ( error ) {
33+
throw error;
34+
}
35+
}
36+
```
37+
38+
</section>
39+
40+
<!-- /.usage -->
41+
42+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
43+
44+
<section class="notes">
45+
46+
</section>
47+
48+
<!-- /.notes -->
49+
50+
<!-- Package usage examples. -->
51+
52+
<section class="examples">
53+
54+
## Examples
55+
56+
``` javascript
57+
var repl = require( '@stdlib/repl' );
58+
59+
// Start the REPL:
60+
repl( onStart );
61+
62+
function onStart( error, r ) {
63+
if ( error ) {
64+
throw error;
65+
}
66+
// After the REPL has started, exit the process...
67+
setTimeout( onTimeout, 2500 );
68+
69+
function onTimeout() {
70+
r.close();
71+
}
72+
}
73+
```
74+
75+
</section>
76+
77+
<!-- /.examples -->
78+
79+
80+
---
81+
82+
<section class="cli">
83+
84+
## CLI
85+
86+
<section class="usage">
87+
88+
### Usage
89+
90+
``` bash
91+
Usage: stdlib-repl [options]
92+
93+
Options:
94+
95+
-h, --help Print this message.
96+
-V, --version Print the package version.
97+
```
98+
99+
</section>
100+
101+
<!-- /.usage -->
102+
103+
104+
<section class="examples">
105+
106+
### Examples
107+
108+
``` bash
109+
$ stdlib-repl
110+
Starting REPL...
111+
```
112+
113+
</section>
114+
115+
<!-- /.examples -->
116+
117+
</section>
118+
119+
<!-- /.cli -->
120+
121+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
122+
123+
<section class="references">
124+
125+
</section>
126+
127+
<!-- /.references -->
128+
129+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
130+
131+
<section class="links">
132+
133+
</section>
134+
135+
<!-- /.links -->

0 commit comments

Comments
 (0)