dom-console
dom-console copied to clipboard
Inspiration for improvement
- https://github.com/dfkaye/dom-console
- https://github.com/Oaxoa/Conzole
- http://oaxoa.github.io/Conzole/
- https://www.npmjs.com/package/termly.js
- https://www.npmjs.com/package/term.js
- https://www.npmjs.com/package/tty.js
- https://www.npmjs.com/package/cltty.js
// .dcrc (dom console rc file)
// var global = { __proto__: window }
// Object.defineProperty(global, 'ls', {
Object.defineProperty(window, 'ls', {
// configurable: true,
// ...
get: function () {
var cmd = function (a,b,c) { console.log('execute command `ls`', 'params are `a`, `b`, `c`') }
cmd.valueOf = function () {
setTimeout(function () { console.log('HELP for command `ls`', '...') }, 0)
return 'ls'
}
return cmd
}
})
use
// devtools console
ls
// function ls
// => HELP for command `ls`
// ...
ls(1,2,3,4)
// execute command `ls` params are `a`, `b`, `c`
ls`foo bar`
// execute command `ls` params are `a`, `b`, `c`
maybe the above needs some more thoughts about:
- how to store references to "processes" (think:
ps) - how to make more "cli commands" and have an overview over all of them?
- ... more? ... what about "piping"?