@dev

  • typedef
{Object}  

A module loaded in development after @config but before main. It typically loads development-only tools. By default, it loads steal/dev.js which provides the following values on a global steal.dev:

Object

Properties

  1. logLevel=0 {Number}Optional

    Controls what types of messages will be logged. By default the logLevel is 0 so all messages will be logged.

  2. warn {function()}

    Writes out a warning message if logLevel is less than 2.

  3. log {function()}

    Writes out a message with console.log if logLevel is less than 1.

  4. assert {function()}

    Throws an error if the expression passed to it is falsy.

Use

Call steal.dev.log to log development info. For example:

steal.dev.log("app is initializing");

Call steal.dev.warn to log warning information. For example:

steal.dev.warn("something went wrong");

Call steal.dev.assert to test for truthiness of the expression provided. For example:

steal.dev.assert("foo" === "bar"); // throws!

By default, steal-tools will remove steal.dev.log, steal.dev.warn and steal.dev.assert calls from the built output.

Help us improve StealJS by taking our community survey