Comparing version 0.2.2 to 0.2.3
{ | ||
"name":"torch", | ||
"description":"CLI logger with colors and deep inspection.", | ||
"version":"0.2.2", | ||
"version":"0.2.3", | ||
"homepage":"http://github.com/TorchlightSoftware/torch", | ||
@@ -6,0 +6,0 @@ "repository":"git://github.com/TorchlightSoftware/torch.git", |
# Torch | ||
Shed some light on the dark morass that is your code. A logger with colors and deep inspection. | ||
Shed some light on the dark morass that is your code. | ||
Torch is a logger with three primary functions: | ||
* supports colors | ||
* automatically runs util.inspect on all arguments, showing nested object/array contents | ||
* can be used to show elapsed time | ||
## Basic Usage | ||
```javascript | ||
@@ -15,2 +23,21 @@ log = require('torch'); | ||
## Showing Elapsed Time | ||
This can be helpful in identifying slow areas of code, or in running benchmarks. You can utilize your existing log statements, and just enable elapsed time printouts. | ||
```javascript | ||
logger.toggleElapsed(); | ||
second = function() {logger.yellow('initiate launch sequence');}; | ||
third = function() {logger.white('begin countdown');}; | ||
logger.blue('clear the area'); | ||
setTimeout(second, 30); | ||
setTimeout(third, 70); | ||
// 0 ms: clear the area | ||
// 32 ms: initiate launch sequence | ||
// 39 ms: begin countdown | ||
``` | ||
Torch uses Chalk. For a full list of supported colors, see Chalk's readme: https://github.com/sindresorhus/chalk | ||
@@ -17,0 +44,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5441
68