static-console-plugin-alert-output
Plugin for printing your static-console
messages using window.alert
.
Install
$ npm install --save static-console-plugin-alert-output
API
AlertOutput
const c = ;const AlertOutput = ; coutputsmyLog = ;croutersstdtasks;// We add task for StdRouter bundled with StaticConsole to convert messages with RawModel c;c;
Test in any browser environment bundled with Node.js.
c.outputs.myLog
is now invoking alert modal with each new message.
AlertOutput
may be used as alternative to standard output in case when it is not available.
Note: alert
has blocking implementation, used in syncronised code. If you want non-blocking API, try other plugin for static-console
.
print(model)
model
is the object that should have descriptive properties:
data
- string with message. It could be converted with RawModel.
window
Defines window in which alert
will be called. Default: window
.