builtin/consoleModule

Synopsis

SilkJS builtin console object.

Description

The builtin/console object provides a minimal implementation of the client-side console object.

Usage

var console = require('builtin/console');

See Also

The JavaScriptimplementation of a more robust console object:
modules/console.js

Function: console.log

Synopsis

console.log(s);

Write a string to stdout.

Arguments

  • {string} s - the string to write to stdout

Back to top


Function: console.error

Synopsis

console.error(s);

Write a string to stderr.

Arguments

  • {string} s - the string to write to stderr

Back to top


Function: console.getPassword

Synopsis

var password = console.getPassword(prompt);

Display a prompt and readin a password without echoing the characters to the display.

Arguments

  • {string} prompt - prompt on the line to get the password

Returns

  • {string} password - the password entered by the user

Back to top


Function: console.getSize

Synopsis

var size = console.getSize();

Get size of console window in rows and columns

The size object returned contains the following members:
rows: number of rows the terminal can display
columns: number of columns the terminal can display

Returns

  • {object} size - object containing dimensions, as described above.

Back to top


blog comments powered by Disqus