string-kit
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -151,2 +151,29 @@ | ||
<a name="ref.inspect"></a> | ||
### .inspect( [options] , variable ) | ||
* options `Object` display options, the following key are possible: | ||
* style `String` this is the style to use, the value can be: | ||
* 'none': (default) normal output suitable for console.log() or writing into a file | ||
* 'color': colorful output suitable for terminal | ||
* 'html': html output | ||
* depth: depth limit, default: 3 | ||
* nofunc: do not display functions | ||
* funcDetails: display function's details | ||
* proto: display object's prototype | ||
* variable `mixed` anything we want to inspect/debug | ||
It inspect a variable, and return a string ready to be displayed with console.log(), or even as HTML output. | ||
It produces a slightly better output than node's `util.inspect()`, with more options to control what should be displayed. | ||
Since `options` come first, it is possible to use `bind()` to create some custom variable inspector. | ||
For example: | ||
```js | ||
var colorInspect = require( 'string-kit' ).inspect.bind( undefined , { style: 'color' } ) ; | ||
``` | ||
## Escape functions collection | ||
@@ -153,0 +180,0 @@ |
{ | ||
"name": "string-kit", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A string manipulation toolbox, featuring a string formater (inspired by printf), a variable inspector (output featuring ANSI color and HTML) and various escape function (shell argument, regexp, html, etc).", | ||
@@ -5,0 +5,0 @@ "main": "lib/string.js", |
@@ -151,2 +151,29 @@ | ||
<a name="ref.inspect"></a> | ||
### .inspect( [options] , variable ) | ||
* options `Object` display options, the following key are possible: | ||
* style `String` this is the style to use, the value can be: | ||
* 'none': (default) normal output suitable for console.log() or writing into a file | ||
* 'color': colorful output suitable for terminal | ||
* 'html': html output | ||
* depth: depth limit, default: 3 | ||
* nofunc: do not display functions | ||
* funcDetails: display function's details | ||
* proto: display object's prototype | ||
* variable `mixed` anything we want to inspect/debug | ||
It inspect a variable, and return a string ready to be displayed with console.log(), or even as HTML output. | ||
It produces a slightly better output than node's `util.inspect()`, with more options to control what should be displayed. | ||
Since `options` come first, it is possible to use `bind()` to create some custom variable inspector. | ||
For example: | ||
```js | ||
var colorInspect = require( 'string-kit' ).inspect.bind( undefined , { style: 'color' } ) ; | ||
``` | ||
## Escape functions collection | ||
@@ -153,0 +180,0 @@ |
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
64437
454