Suppose I want to implement a curses/console like program in HTML/CSS/Javascript. Examples might be a online text adventure game or a simple interpreter similar to the "Try the XYZ programming language now" web pages you see for languages like Ruby or Haskell. Is there a library/plugin/etc... that implements these terminal like interfaces?
Note:
After digging around for quite some time I found jquery-console, which looks quite promising at first glance.
Any other alternatives or recommendations?
In JavaScript, the console is an object which provides access to the browser debugging console. We can open a console in web browser by using: Ctrl + Shift + I for windows and Command + Option + K for Mac. The console object provides us with several different methods, like : log()
JavaScript frameworks are collections of JavaScript code libraries that provide developers with pre-written code to use for routine programming features and tasks—literally a framework to build websites or web applications around. Popular JavaScript front-end frameworks include React, React Native, Angular, and Vue.
You can also enter into the JavaScript Console by using the keyboard shortcut CTRL + SHIFT + J on Linux or Windows, or COMMAND + OPTION + J on macOS, which will bring focus immediately to the Console. Now that you have accessed the Console, you can begin working within it in JavaScript.
The log() method writes (logs) a message to the console.
I have been using the termlib.js library for a couple of projects and it works really great. It helps with a lot of stuff like handling keyboard and parsing inputs.
It should also be less bloated than any jQuery-based solution unless you were going to use jQuery anyway.
You might want to start off looking at the readme or try some samples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With