JavaScript library that overrides the console object bringing its functionality in a DOM element.
Copy the library file (located in lib
directory) into your app and include it into the webpage:
<script src="path/to/console.min.js"></script>
This creates the ConsoleJS
global. To initialize the console do:
ConsoleJS.init({
selector: "pre.console"
// This is optional. Provide it if you want
// the user to run custom stuff, otherwise the
// ConsoleJS will run in the readonly mode.
, input: "textarea.js-code-to-run"
});
Adds a new element where the console will show the output.
-
Object
options
: The DOM element (or query selector) or an object containing the following fields: -
selector (String|HTMLElement): The DOM element or query selector.
-
input (String|HTMLElement): The DOM element or query selector. This is the element where the user inputs the code (could be a
textarea
,input
or so).
Goes back in the history.
- Object An object containing the
command
field.
Goes to the next command in the history.
- Object An object containing the
command
field.
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
-
Starring and sharing the projects you like π
-
βI love books! I will remember you after years if you buy me one. π π
-
βYou can make one-time donations via PayPal. I'll probably buy a
coffeetea. π΅ -
βSet up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
-
BitcoinβYou can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! β€οΈ