dom-console icon indicating copy to clipboard operation
dom-console copied to clipboard

Inspiration for improvement

Open serapath opened this issue 9 years ago • 2 comments

  • https://github.com/dfkaye/dom-console
  • https://github.com/Oaxoa/Conzole
  • http://oaxoa.github.io/Conzole/

serapath avatar Mar 13 '16 18:03 serapath

  • 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

serapath avatar Jun 08 '17 01:06 serapath

// .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"?

serapath avatar Jun 08 '17 02:06 serapath