browser-console-listener
Listen for things typed in the browser console.
Usage
console; var bcl = ;var listener = ; listener;
API
var bcl = require('browser-console-listener')
var listener = bcl(host)
Create a listener for the given host object. Pass window
as host
to achieve the desired effect in browser console.
listener.listen(answers, callback)
Listen for an answer.
answers
Array of strings. A getter will be defined on host object for each answer. There cannot already be a property on host object with same name as any answer.
callback
Function invoked when user types an answer. It is passed the selected answer (string).
listener.cancel()
Stop listening for answers. Remove getters from host object.
Install
npm install browser-console-listener
bower install browser-console-listener
License
MIT