API Usage
Path:
/src/index.coffee
compiled to/lib/index.js
This module exports different modules to be used alltogether or singular.
Three methods which are usable for all types are directly accessible in the main module: -inspect() - direct use of the NodeJS core method -clone - make a deep clone -extend - extend objects by mapping other ones into this
All other helper are used through a collection named after their type:
-string - methods for working with String
objects
-object - methods for working with Object
objects
-array - methods for working with Array
objects
-number - methods for working with Number
objects
-function - methods for working with Function
objects
Debugging
This module uses thedebug module so you may anytime call your app with
the environment setting DEBUG=util:*
but keep in mind that this will output a
lot of information. So better use the concrete setting in each module. Most have one
defined with their name:
DEBUG=util:* -> complete util package
DEBUG=util:clone -> only clone method
DEBUG=util:extend -> only extend method
This should output something like (from clone method) on STDERR:
util:clone -> { maxCpu: '95%', maxLoad: '400%' } +0ms
util:clone ++ [] +0ms
util:clone -> '95%' +0ms
util:clone <- is primitive +0ms
util:clone -> '400%' +0ms
util:clone <- is primitive +0ms
util:clone <- cloned object +0ms
util:clone -> { nice: -20 } +0ms
util:clone ++ [] +0ms
util:clone -> -20 +0ms
util:clone <- is primitive +0ms
util:clone <- cloned object +0ms