nanoterm
v0.1.2
Published
pluggable unix emulator for the browser
Readme
nanoterm
unix terminal emulator
in your browser
- built on xterm.js
- use as a library from TS/JS
- pluggable shell (provides its own by default.)
- bring your own filesystem, or use one of the provided:
- in-memory - default
- localStorage - for client-side persistence
- apply a docker-style file system overlay at build-time (available for all filesystems)
- custom commands, configurable styling, tree-shakable.
install
npm install nanotermimport { createNanoTerm } from 'nanoterm';
createNanoTerm(document.getElementById('terminal')!);commands
- comes pre-packaged with the following commands:
cat
cd
chmod
clear
cp
date
echo
env
export
grep
head
help
history
ls
mkdir
motd
mv
nano
pwd
rm
tail
touch
tree
uname
wget
whoami
wcnash
The default shell is nash. Not intended to provide POSIX shell compatibility. It supports variable expansion, NAME=value assignment, &&, and stdout redirects (>/>>). It does not yet implement pipes, ||, subshells, globbing, or stdin/stderr redirects.
The js code for the shell interpreter is generated from an OCaml spec, included here
