-
Notifications
You must be signed in to change notification settings - Fork 10
Advanced options
malgorithms edited this page Oct 25, 2012
·
16 revisions
You can pass or assign the following options to a Toffee engine:
-
prettyPrintHtml: bool(default = true): by default, if Toffee hits an error while rendering, it will pretty print a stack trace and overlay it on the resulting page. And it will fake a "good" result, calling back with null, res. Setting this to false calls back with (err) instead. -
prettyLogHtml: bool(default = true): since prettyPrintHtml=true replies without an error, your software (say, Express), won't log errors to the console. You probably want to set this to false if you set prettyPrintHtml to false, too. -
verbose: bool(default = false): Toffee will log some information on what it's doing during renders -
additionalErrorHandler: function: If Toffee encounters a render error, it will call your function with three parameters: (plaintext stack trace, html stack trace, and filename (if available). We use that setting instead of prettyLogHtml to customize how its logged. You could use have this email your staff when in production, for example. Whatever. -
minimize: bool(default = false): Toffee will minimize the JavaScript using uglify-js inside the renderer. This typically isn't something you want to do, as it's more computationally intensive to compile a template with no performance gains. However it exists because the command linetoffeeprogram can use it for generating smaller browser-side templates.