GithubHelp home page GithubHelp logo

jsterm's Introduction

jsterm

jsterm is a terminal simulator that uses a JSON filesystem. To see it in use, check out clarkduvall.com.

Disclaimer

Most of this was written awhile ago when I knew JavaScript about as well as I know Spanish (which is a little, but not much). It is due for a rewrite with some cool new features like pipes, writable files, and other magic.

How To Use

At the bottom of the js/jsterm.js file, there is a series of term.enqueue() calls. This is where the commands are set that are run when the page loads. Other changes can be made to personalize your terminal. The directory structure is as follows:

  • commands - A JS file with all the possible commands that can be run. Add new commands here.
  • config - A JS file that has basic configuration information. Change things like the prompt here.
  • css - The CSS used on the page.
  • images - Image files used in your filesystem.
  • js - The jsterm implementation.
  • json - Where the filesystem is stored. Change the term.Init() call in js/jsterm.js to change which filesystem is loaded.

For the loading of the filesytem to work locally, you must server the files in the directory from a local server. To do this easily, change into the jsterm directory and run:

python -m SimpleHTTPServer 8000

Filesystem Format

A filesystem is a recursive grouping of JSON arrays of objects. Each nested array represents the listing of items in a directory. Each object in the array defines a file or directory. For an example, see json/sample.json.

make_fs.py

This is a script that will create a jsterm filesystem from a real directory. Examples of how to make different file types are as follows:

  • Text file (no execute permissions):
This is a text file.
  • Executable/link (MUST BE MARKED EXECUTABLE):
http://google.com
  • Image file: can be any image file with a standard extension (e.g. .png, .jpg)

Attribution

If you use jsterm, it would be great if you could link to this GitHub repo. Thanks!

jsterm's People

Contributors

clarkduvall avatar

Watchers

James Cloos avatar JackyTao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.