Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32106fc

Browse filesBrowse files
author
Arne Claassen
committed
Update README.md
1 parent 54d171d commit 32106fc
Copy full SHA for 32106fc

File tree

Expand file treeCollapse file tree

1 file changed

+48
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+48
-3
lines changed

‎README.md

Copy file name to clipboard
+48-3Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,49 @@
1-
shell.js
2-
========
1+
josh.js 0.1
2+
===========
33

4-
Toolkit for building bash-like shell in the browser, including full readline support
4+
***Javascript Online SHell*** provides a toolkit for building bash-like command line consoles for web pages. It consists of the following components:
5+
6+
* `readline.js` - full readline support for ctrl sequences, tab, history, etc.
7+
* `shell.js` - visual presentation of the shell and command handling
8+
* `pathhandler.js` - provide cd, ls, pwd and path completion toolikit
9+
* `history.js` - localStorage backed command history
10+
11+
## License
12+
josh.js is licensed under the Apache 2.0 License
13+
14+
## Status
15+
16+
* code is ready for use
17+
* needs minified versions of complete toolkit and just readline.js
18+
* needs code documentation and documenation site
19+
20+
## Usage
21+
22+
Until documentation is written, refer to `index.html` and `example.js` for a sample implementation of a shell with path completion.
23+
24+
## Components
25+
***josh*** is built from 4 components and can be used in part or in full.
26+
27+
### readline.js
28+
29+
`readline.js` has no dependencies on any outside libraries, although it requires either `history.js` or an object implementing the same calls.
30+
31+
It implements key trapping to bring [GNU Readline](http://cnswww.cns.cwru.edu/php/chet/readline/readline.html) like line editing to the browser. It can be used by itself to bring readline support to custom data entry fields or in conjunction with `shell.js` to create a full console.
32+
33+
### shell.js
34+
`shell.js` has external dependencies of [jQuery](http://jquery.com/), [Underscore](http://underscorejs.org/) and internal dependencies of `readline.js` and `history.js`.
35+
36+
It provides a simple console UI, using a *panel* for the console viewport and an auto-scrolling *view* inside the panel. It uses Underscore templates for generating the view html, although any template generator can be substituted as long as it can be expressed in the form of a function that takes a JSON object of arguments and returns an html string.
37+
38+
It also implements command handling so that new commands can be added by name with execution and completion handlers. Out of the box, `shell.js` provides the following commands:
39+
* help - list all known commands (including user added)
40+
* clear - clear the "screen" i.e. viewport
41+
* history - show the command history captured by `readline.js` in `history.js`
42+
43+
### pathhandler.js
44+
`pathhandler.js` is a mix in to easily add the `cd`, `ls` and `pwd` commands as well as path completion. It has the same external dependencies of [jQuery](http://jquery.com/), [Underscore](http://underscorejs.org/) as `shell.js` and also uses Underscore templating.
45+
46+
By implementing the functions `getNode` and `getChildNodes`, this library adds path traversal, discovery and completion just like a bash shell.
47+
48+
### history.js
49+
`history.js` implements a localStorage back command history storage that persists over page changes and reloads. It is used by the `shell.js` history command to list all executed commands, and by `readline.js` for up/down arrow and reverse search capabilities.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.