Skip to content
A Javascript scripting engine for DOS
Branch: master
Clone or download
Latest commit 6745c1b Jun 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode first release Jun 1, 2019
doc first release Jun 1, 2019
jsboot first release Jun 1, 2019
mujs first release Jun 1, 2019
.gitignore first release Jun 1, 2019
CHANGELOG.md first release Jun 1, 2019
CWSDPMI.EXE first release Jun 1, 2019
LICENSE first release Jun 1, 2019
Makefile first release Jun 1, 2019
README.md Update README.md Jun 1, 2019
file.c first release Jun 1, 2019
file.h first release Jun 1, 2019
funcs.c first release Jun 1, 2019
funcs.h first release Jun 1, 2019
jSH.c first release Jun 1, 2019
jSH.h first release Jun 1, 2019
jc.bat first release Jun 1, 2019
jc.js first release Jun 1, 2019
jsconio.c first release Jun 1, 2019
jsconio.h first release Jun 1, 2019
renall.js first release Jun 1, 2019

README.md

jSH

jSH logo

A Javascript scripting engine for DOS

jSH is a script interpreter for DOS based operating systems like MS-DOS, FreeDOS or any DOS based Windows (like 95, 98, ME). The focus is on file io and text mode user interfaces.

jSH is a side project to DOjS, a Javascript canvas for creative coding.

The following script e.g. renames all file extensions in a given directory:

if (args.length < 3) {
	Println("Usage:");
	Println("   jSH.exe renall.js <dir> <old ext> <new ext>");
	Exit(1);
}

var dir = args[0];
var oldExt = args[1].toUpperCase();
var newExt = args[2].toUpperCase();

var files = List(dir);
for (var i = 0; i < files.length; i++) {
	var oldName = files[i].toUpperCase();
	if (oldName.lastIndexOf(oldExt) != -1) {
		var baseName = oldName.substring(0, oldName.lastIndexOf(oldExt));
		var newName = baseName + newExt;
		Println(dir + "\\" + oldName + " => " + dir + "\\" + newName);
		Rename(dir + "\\" + oldName, dir + "\\" + newName);
	}
}
Println("All done...");

And can be run like this: JSH.EXE RENALL.JS SOMEDIR .FOO .BAR to rename all files ending in .FOO to .BAR.

DOjS was only possible due to the work of these people/projects:

You can find me on Twitter if you want...

Download and quick start

You can find binary releases on the GitHub release page. Just extract the contents of the archive and run jSH.

jSH runs in Dosbox and on real hardware or a virtual machine with MS-DOS, FreeDOS or any DOS based Windows like Windows 95/98/ME.

If you run it on real hardware you need at least a 80386 with 4MB. I recommend a Pentium class machine with at least 8MB RAM.

The API is documented in the doc/html/ directory.

For now jSH comes only with a single bigger example: JsCommander. A minimal file manager in the style of the well known Norton Commander. jc screenshot

Compilation

You can compile jSH on any modern Linux (the instructions below are for Debian based distributions) or on Windows 10 using Windows Subsystem for Linux (WSL). Setup Windows Subsystem for Linux (WSL) according to this guide (I used Ubuntu 18.04 LTS).

Preparation

Build and install DJGPP 7.2.0 according to this guide. I used the following command lines to update/install my dependencies:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip htop screen git bash-completion build-essential npm
sudo npm install -g jsdoc
sudo npm install -g tui-jsdoc-template

And the following commands to build and install DJGPP to /home/ilu/djgpp.:

git clone https://github.com/andrewwutw/build-djgpp.git
cd build-djgpp
export DJGPP_PREFIX=/home/ilu/djgpp
./build-djgpp.sh 7.2.0

Getting & Compiling jSH

Open a shell/command line in the directory where you want the source to reside.

Checkout jSH from Github:

git clone https://github.com/SuperIlu/jSH.git

Open the Makefile in a text editor and change the path to DJGPP according to your installation.

Now you are ready to compile jSH with make clean all. This might take some time as the dependencies are quite a large. make distclean will clean dependencies as well. make zip will create the distribution ZIP and make doc will re-create the HTML help.

History

See the changelog for the projects history.

Licenses

jSH

All code from me is released under MIT license.

MuJS

MuJS is released under ISC license. See COPYING in the MuJS folder for details.

CWSDPMI.EXE

CWSDPMI DPMI host is licensed under GPL. The documentation states:

The files in this binary distribution may be redistributed under the GPL (with source) or without the source code provided.

You can’t perform that action at this time.