{"_id":"haraldutil","_rev":"60-35c2d5e58ce7606b62eed89e59a27d02","name":"haraldutil","description":"App utility functions by Harald Rudell","dist-tags":{"latest":"0.1.18"},"versions":{"0.0.4":{"name":"haraldutil","description":"Utility functions for the global scope","version":"0.0.4","contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://blog.haraldrudell.com"}],"repository":{"type":"git","url":"git://github.com/haraldrudell/haraldutil.git"},"main":"./util","_npmUser":{"name":"haraldrudell","email":"harald@therudells.com"},"_id":"haraldutil@0.0.4","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"8367467e0885659b0c5d4dde4fa2eb1030c6cc62","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.4.tgz","integrity":"sha512-Fjry3uOqIi8mwjn5IpxoYAP3qqbYLeYrJkV2FliLepq3S1V3KGvwsTa1gIlhdiPFh9POzA0aa04Z37AWg6RZYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+qyFIVF5bqVowgZDwinUt9fSygdyuFSlftiw8TzFV0AIhANUKRyz4M/f1wYZNEhEhu9Kt0t++V//g+D9vtBxQDvsy"}]},"readme":"","maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.5":{"name":"haraldutil","description":"Utility functions for the global scope","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com"},"version":"0.0.5","contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://blog.haraldrudell.com"}],"repository":{"type":"git","url":"git://github.com/haraldrudell/haraldutil.git"},"main":"./util","_npmUser":{"name":"haraldrudell","email":"harald@therudells.com"},"_id":"haraldutil@0.0.5","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"4fab3e11392d15b38ea8631d46f0e0671eb61df2","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.5.tgz","integrity":"sha512-+9r1fV93eP5RdgRjePPo5Y9lOaeGQd4iZeHbAtoOxawlsu2d7h7DaGV4X2UJ0fpAbvmnM0t1moVktN7K37EmPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoesqZFkP77aNGF83ETMGsEgS4u61cjM7Kwrt9m77vOQIgUqyNFe6dSjmuhFMWYRlTmPBRW1ofL9znjzXhm4DfteA="}]},"readme":"","maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.6":{"name":"haraldutil","description":"Utility functions for the global scope","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com"},"version":"0.0.6","contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://blog.haraldrudell.com"}],"repository":{"type":"git","url":"git://github.com/haraldrudell/haraldutil.git"},"main":"./lib/haraldutil","_npmUser":{"name":"haraldrudell","email":"harald@therudells.com"},"_id":"haraldutil@0.0.6","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"da0e30a958306c600e467571e1e9fb15a404da31","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.6.tgz","integrity":"sha512-mDHVZwnKsyirvK8jznwe2PhI7zEUldpMxIvLwEbLTlUNpYOYOLBfsudnOVrMAbCb3sFxTaHtOo6NOsCJOaOIBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDLSPIehV7DtcaRtXgdjCGb+957Uq2pt2C6QrBbzeqDAiEA2Axy/N7FlUb+4oHgaE8Bb2GPMm/a5n5xn+6/PX4ifgM="}]},"readme":"","maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.7":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.7","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"nodeunit":"","uglify-js":"","greatjson":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"nodeunit test"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspect(v, optsArg)\nreturn value: printable string\n\n* opts: optional object\n* .maxString: optional number: max string characters to print, default 40\n* .maxProperties: optional number: max properties to print, default 10\n* .maxLevels: optional number: max levels of objects and arrays to print, default 2\n* .nonEnum: optional boolean, default false: printing of non-enumerable object properties\n* .noArrayLength: optional boolean, default false: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing v value and type.\n\n### inspectDeep(v)\nprovide unique all-encompassing string describing v value and type, but do not print non-enumerable object properties.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.7","dist":{"shasum":"f9fc5f1f390ccd766829fd05b7c84a316eec6119","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.7.tgz","integrity":"sha512-eGRLexEKKMWYmuWYRCjKwtHQKOQF/8uUhHt7VOmP/M6g9/f+mWZLZfnkw6KF591x69sXvnFFwM7JVpvKoXA/qQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5lvyqywZYFny0tQQfW4935EEZ6lcdOByNT8Zj7VzQzAiALsF+cY5yf6ldZQ++UulvOXVY5aAYRVtUMDpavOjQYew=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.8":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.8","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"nodeunit":"","uglify-js":"","greatjson":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"nodeunit test"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspect(v, optsArg)\nreturn value: printable string\n\n* opts: optional object\n* .maxString: optional number: max string characters to print, default 40\n* .maxProperties: optional number: max properties to print, default 10\n* .maxLevels: optional number: max levels of objects and arrays to print, default 2\n* .nonEnum: optional boolean, default false: printing of non-enumerable object properties\n* .noArrayLength: optional boolean, default false: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing v value and type.\n\n### inspectDeep(v)\nprovide unique all-encompassing string describing v value and type, but do not print non-enumerable object properties.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.8","dist":{"shasum":"34fb652db0770af88998a6cbefa3d9f2d1c21e50","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.8.tgz","integrity":"sha512-8ou3mVdrtzHUGTBUkNV44j2FrYvo03ZR6W2dujmnTZmZi/vhf6plcmtYz+ra96kS2l4ncopPBeMikjT/lIBnSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBZYEkl5B30BFWBeHS5aVLa7Z2HtNgsyvhRUJ3qojbH/AiAbfsIWhLCvK7LN2pFHR79udCeUCp4+ObaOihwGQp0ovQ=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.9":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.9","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspect(v, optsArg)\nreturn value: printable string\n\nAny value os formatted for exactly identifying type and value and will not contain unprontable characters\n\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10elements.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.9","dist":{"shasum":"b5c533d1923bdc2fdb80f3ed995f4568bf448a18","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.9.tgz","integrity":"sha512-Ck+jSaWthlXWeKHCp0agYWwIXnxMacIVfnadNeDMH4s4kHuJjAoAhjBqs6rOVXjvq0ZrlaHXMZYB13rL5znx3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDqBt8Np+HkBY+ZXWIbFxPdNPse8xG9U35CJpPz9sx2AiEAqoFklsEhMHi/xY9se+T6NXqbXKJVj6jTi3F9bkQunA4="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.10":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.10","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspect(v, optsArg)\nreturn value: printable string\n\nAny value os formatted for exactly identifying type and value and will not contain unprontable characters\n\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10elements.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames arrau\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.10","dist":{"shasum":"698c0b6ba61dd117226a78e5fdebe0ab992ca558","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.10.tgz","integrity":"sha512-O06J/wgh6LfMvoUZ+U8QnenLfipi5Msic/R3fUvr14OF0/vA0PWx/bXZ2ew6Nm7jFlMFPxF1aIhjbUlz3bvtYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBLdmVxHgH2l3hSPQVqz4OpRRGu+M4AlRpRqWoxsafVAiEAmHkHo+KthsdWS185EuiXAv98x23b/bWG/qMA8yB87uQ="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.11":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.11","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspect(v, optsArg)\nreturn value: printable string\n\nAny value os formatted for exactly identifying type and value and will not contain unprontable characters\n\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10elements.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames arrau\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.11","dist":{"shasum":"07cc17d00a8f33d5c7846e1ce68e74f85c026b52","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.11.tgz","integrity":"sha512-S0DcRW3JSsOpkmU2mdp/1O9J9L6kzUpUBECEuJejrgyw7OnDIhSQ+54pWPRnkcO09ByDCd+5Vv2NH1Cnk5DMxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOSRtEbB/BQj6K1IBEMg7RzV0dR+ZYxpmm+95B2ODhIQIgfR8YjpDQbVeep2mzf2MSCizDEMDOPwqAxNvBum84nrY="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.12":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.12","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames arrau\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.12","dist":{"shasum":"f7e3176034db0c6949e5ab4d6e7dcf7cb01733e1","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.12.tgz","integrity":"sha512-zTDvzFBlXWRixlQIeTJAGXVz5ZDwN1NCVRTN5U2eTa2W/XABu0hAKpEwPXpdzZkps//ACxbLOzY9pOBIdVdRsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNArls+hpXYkxmeYsPMy7y9HC0YQradxqeW2biqw94FQIhAPed1BzKB4t/I+xZnkHQ1DUKrwcyP29Nbp4jpacyD/Vf"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.0.13":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.0.13","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window displaying the location url.\n\n### getType(path1)\nDetermine what path1 is.\n\nreturn value:\n\n* undefined: path1 does not exist\n* false: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames arrau\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### logException(e, heading, printmethod, offset)\nLog detauils about an exception.\n\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* Offset possible call stack offset, default callers location\n\n### checkSuccess(error, heading, printmethod, offset)\nChecks for success outcome in a callback\n\n* error: callback error argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: method to use for output, default: console.log\n* offset possible call stack offset, default callers location\n* return value: true if there was no error\n\n### logError(e, heading, printmethod, offset)\nOutputs an error to the log.\n\n* e: error value, such as an Error object or catch argument\n* heading: optional heading string, eg. 'reading file'\n* printmethod: mnethod to use for output, default: console.log\n* offset possible call stack offset, default callers location\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n\n* includeObject: prepend object and method, eg. Module.load\n* offset: caller offset in the stack\n* return value: printable string eg. 'file:tracker.js:5:15 function:Object.<anonymous> folder:/home/folder'\n\n### eToString(err)\nConverts an Error object to string including\n\n* Error type and message\n* Stack trace\n* Any hidden or enumerable properties\n\nValues other than Error objects are converted to string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.0.13","dist":{"shasum":"5145de717c831bc33574bfe9be1d6ca8e61a9fe6","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.0.13.tgz","integrity":"sha512-4So/I8XacL/j3uGxQWUd5G9W/crHlBj/3lsPLEgVi6zXT2uINrmK7sAbrzw2cgLVJ+b8LSsnO4hl+ZikhK3rcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDtRYeGUg1DPtLdRkEWZ/7n1mVDjorrWTXb07A9aj6a9AiA/IM7dX6R2ttwb+W4fkNU3sp+GowgZd/qdRLR3Bza0cw=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.0":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.0","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* noTrace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.0","dist":{"shasum":"c0f57ba37a8a4463f8fdd6d8284e3307ae5c68c2","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.0.tgz","integrity":"sha512-gengk+V7uB2IFTWDML8Lw6U0gbZn2tbh5u9j4WNNwBhLDkkck2inb+3oqa1vXg0u+x1w5IPbtxM1+gHMqqwt/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRp6WwEUJLB3SaPSu+dlAVOz9SJE9x2LAt889IUtTzMgIhAIiormdH71i4G4QosM97us1rS/X1T7W4TUcrpPamsrE1"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.1":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.1","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(emitter)\n* emitter: optional event emiter or boolen\n* default: errors are thrown\n* false: errors are ignored\n* emitter: errors are emitted\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* noTrace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(includeObject, offset)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.1","dist":{"shasum":"69789d59a4f18a29f8160bf65978b5152e3b9258","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.1.tgz","integrity":"sha512-k5mlvSVlBhA9FSSXHxyC8MIecj4b5IVVmnKDu1Beh2EYm0dX/HrcOVj8EoMPg4Q00Zn2gHc4Rb50xmdSjwktJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3WQTelboU8RJJStTwIFQlvSBJeLrGEuaDWXn7ueHKpgIgHvutnWRe7SuUQ4lWIV3xLf1XjZMIK+AO25wrAWOkF6k="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.2":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.2","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(emitter)\n* emitter: optional event emiter or boolen\n* default: errors are thrown\n* false: errors are ignored\n* emitter: errors are emitted\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.2","dist":{"shasum":"d908186c9ddeca2005ad254511341fa83710d75b","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.2.tgz","integrity":"sha512-P4uY8gRRjFSDsngxs0RMO+LLfA6PEHI6kDAEeYKkX0T2xXcUdl5gXCAeBoA5XAIqZU50KrmMXuqREdwSRQbHSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrmIF9Wl6o0TIdlsb2Qn7XIWHDgpQ1ia2hPBz9LjvqzAIgaw7XtuMwFfV2fprF5B6RHvNQzPATD+XzWJKlZl3wvhg="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.3":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.3","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.3","dist":{"shasum":"789265338aa8da5e189396ea5ddba85bacef799f","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.3.tgz","integrity":"sha512-fXFWorxntEftQ9csWmePqBYCPGUAM1aFSOgxVgxp3+Cjpb2gcGhNEwPCX8U+ZEDX3xni9VghJ8aCJxJ9EfaQGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGi+z6yTyGG5lMhS4IkZKBJrC+y8dlbytarSU44LWot4AiBcUbkkRuhjbcA3u1e3y1h/lACyT7aLc8qic2yY4oI9Ow=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.5":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.5","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.5","dist":{"shasum":"35defd0f0ae70ea4cdfc17d2017abd421eb98d08","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.5.tgz","integrity":"sha512-Hsg+2ASTU0IpbzVh44lQ8P3yXOY950ocLNxnlqPEpIb8ADNnh68LzxEI/AwDkChsQhxq1PhVmtsNGwVNW69i9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2ZKuyEKZoVMe0oav1F4xYhcpnyro0SXIOkinTzYT4hgIhAJnvSGmHEbA286rCEHm3rl/K4e8BoE2tPMorBtN0Hd9U"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.6":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.6","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://haraldrudell@github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.6","dist":{"shasum":"5f3c4957d5d572c83467fd1f92442b5a3929953b","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.6.tgz","integrity":"sha512-avA90DQpTlifoywh3vNONfMG2Iv8ZX48CTUVuQ+rd/NKE4GZOuYEXJwrSjQkDTEFkQElFZbmUuUEKs8Yx/OnEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCvMaj69svZJ0j2ggyzUwZpLE8I5W77XeWHwrWqpB5JgIgEjAVENQ392g0qHazy4UtcyEV4JYRZ7xRacIxhGBa6O8="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.7":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.7","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.7","dist":{"shasum":"073f39adbd2eec3db5031e20ac2b45555026ddad","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.7.tgz","integrity":"sha512-wY7f58xVOFsXjetS+LUB+csVfmLyqLuNavEGHi0TlYCROlUH1SsS01B/RO2RDKp8NQsHh/mPQAiqnoW0JrJkJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUyxA2ldBko6xaGPiRuVNpcl/buSp6wkM+cHeinZvQrQIhAJzCDWvhiXZckl2tWcWi6wa72J61fJYRmwjcn++9PLky"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.8":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.8","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc()\nGets location as file:line\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLoc(), 'Hello')\n```\n```\nexamples.js:61 Hello\n```\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.8","dist":{"shasum":"95f94732a0bfaf246e0744301fa2abcebd756b7e","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.8.tgz","integrity":"sha512-SpMn9tNG63RQGSWMLV1TEYYJS51M9S2kFfw6sTRcYNibqddMaO4MFcOl4dcsS+07QauZjG41JaW/vsea2RFQag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGn9Oxp7dNwV5Fylwdia5k6eHa8JeD/sLmRjymaFXRYfAiB1OGFcPonsAHMJ5TSmnh+wWjk1r/xM9Ur39tejysNcZQ=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.9":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.9","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc()\nGets location as file:line\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLoc(), 'Hello')\n```\n```\nexamples.js:61 Hello\n```\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.9","dist":{"shasum":"be0469f0b06c1e08e61ec9f62aa26421d08d5469","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.9.tgz","integrity":"sha512-pCZRp7K8i1AwO67/HUH59Wc3+22w2qEyJzHq7m/P3+f35Dd++AwkkckxGGjtIYnj0RlSuuD763jwz05xs2IH9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxglKTaVbiPcEWkeVmhEpkn5YVaVwelYruESAHeq59tgIgO+GsCq2jzVoDlb3LZT56LuM3K8oj/jOVzOxUcO+82Zs="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.10":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.10","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc()\nGets location as file:line\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLoc(), 'Hello')\n```\n```\nexamples.js:61 Hello\n```\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.10","dist":{"shasum":"2401cd152cf4eea66f77693c8edb70e98cce3014","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.10.tgz","integrity":"sha512-sKPIiDv1uwHTq6F36lLam5rl+Blel29sS7i0UjYnI9PNWKGgiyeCvhS5PzfFFDLdxxm3oIwFmrBnAaDmTlhJMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG8jR2jvSq4HLwsS2vwT2YRb4hrVWpDAQl4z+2roTs0lAiAVSu8kGx1BilRt1NEsYQDYru3FeXHYOH14WT6OZAq+cA=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.11":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.11","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.11","dist":{"shasum":"6ef2035bfa49f4314a664fd71d9dc31107f5afe0","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.11.tgz","integrity":"sha512-K3cekCEcdJXBrD03ONhdBUREhFbxd6dg0II16IO3zG+WkCNnCeNE6DJlRu81O8mv1/J22AqSdsJ9WPLB9zAo2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGb8SQXSpk9OubRjcuGhCy30xPXD6+fOn0aY+4EwNjJHAiEA/bSyR6t9DYvIAcyrqEpO8nXT1/aXEUf/D/Lrz+mvfYw="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.12":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.12","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.12","dist":{"shasum":"7cd90996a3b8d1b8391d88364807a2fab2a13d7f","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.12.tgz","integrity":"sha512-pfrdnQhhivfJDMW22E5ciQrTjw7cfx0m/pBkcfLPhKvPGlNUffS81RYixCtaCtyDCfLxMytP0kkxcjZLxTM0jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0T2vkTGg+9ffb/3QyTidee9QVvY87YceRI3Wk1acQcAiBU/y9Ahibovj6mFeY0TRgGputjd9nR/X3mz7cyUW9blw=="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.13":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.13","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Flexible and recursive conversion of any value to a string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type. \n\n### getCbCounter()\nEnsures that all callbacks has completed\n\n```js\nvar haraldutil = require('haraldutil')\nvar cbc = haraldutil.getCbCounter()\nsetTimeout(cbc.add(callback), 100)\nsetTimeout(cbc.add(callback), 100)\n\nfunction callback() {\n  if (cbc.isDone(arguments.callee))\n    console.log('All callbacks completed.')\n  else console.log('Not done yet...')\n}\n```\n```\nNot done yet...\nAll callbacks completed.\n```\nvar cbc = getCbCounter(opts)\n* opts: optional object\n* opts.emitter: optional event emitter or boolean. default: errors are thrown\n\n  * false: errors are ignored\n  * emitter: errors are emitted\n\n* opts.callback: function or array of function: add is done for each function\n\ncbc: object\n* .add(f): adds a callback for function f, return value: f\n* .isDone(f): notes one callback completed. returns true if all callbacks complete, otherwise false\n* .getStatus(): gets an object representing the current state\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### getJsonStore(opts, cb)\nFacilitates easy save of objects in the filesystem.\n\n```js\nvar haraldutil = require('haraldutil')\nvar store = haraldutil.getJsonStore({name: 'json'})\nstore[store.getNextId()] = {key: 'value'}\nstore.save()\n```\n\nopts: object\n* .name: string filename\n\n  * default name is 'temp'\n  * default extension is .json\n  * default folder is a suitable temp folder\n\n* emitter: optional error emitter, default: errors are thrown\n\n  * false: errors are ignored\ncb: optional callback\n\nreturn value: store object\n* .save(cb(err)): save to disk\n* .getNextId(): gets a new serial number\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.13","dist":{"shasum":"6e86e06e93c2f4d49483b52385a2e16befc9ab90","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.13.tgz","integrity":"sha512-VWNshDpwpwRLzX8YqPUwQ9fQsB4MuZuzPOmcJrd/t+gocJLp49PkinvEvSepVAGEjD6OPMXSGhBfNN/le3XVhg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdliryuHVbJnIYqJv0Zkh5F1qZr9S+1117BEl2tkowpQIgbtIvbr9w/b1Rr8G2Em9OIDjm/farLEmMwKyjGv+02NQ="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.14":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.14","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n1. Convert any object or value to a printable string extacly defining types and values\n2. Handle object function arguments with helper functions\n3. Easily parse, filter and print error results, stack traces and code locations\n4. Read numbers in a strict way\n5. Handle, convert and compare time formats and timezones\n\n## Features\n\n1. Conversion of any value to printable string representation\n2. Object manipulation methods\n3. Portable path, number and browser functions\n4. Error and stack trace parsers and string conversions\n5. JavaScript time value, Unix timestamp and timezone functions\n\n# Reference\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### getHomeFolder()\nGet the path to the user's home folder\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Home folder:', haraldutil.getHomeFolder())\n```\n```\nHome folder: /home/foxyboy\n```\n\n### getHomeFolder()\nGet path to a folder for temporary files\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Tmp folder:', haraldutil.getTmpFolder())\n```\nTmp folder: /home/foxyboy/tmp\n```\nif the user's home folder has a tmp, this is used. Otherwise, the systems temporary files folder is provided.\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not have daylight data for timezones\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern time\n\n### CreateKey(s1, s2, ...)\nConstruct a unique string value based on the function arguments.\n```js\nvar haraldutil = require('haraldutil')\nvar dbServer = 'server'\nvar dbTable = 'table'\nvar dbTable2 = 'table2'\nvar key1 = haraldutil.createKey(dbServer, dbTable)\nvar key2 = haraldutil.createKey(dbServer, dbTable2)\nif (key1 !== key2) console.log('not the same')\n```\n```\nnot the same\n```\n\n* If any argument is not a non-empty string, exception is thrown\n* For keys to match, every string argument at their creation must have been exactly the same\n\n### periodString(num)\nprovide a human-readable string expressing a time period to two-digit precision\nvar haraldutil = require(```js\n'haraldutil')\nconsole.log('The world will come to an end in:', haraldutil.periodString(1e7))\n```\n```\nThe world will come to an end in: 2 h 46 min\n```\n\n* num: timevalue, unit: ms, positive value\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.14","dist":{"shasum":"9ead50a4ead10f8379bd47227c1f2465a6856679","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.14.tgz","integrity":"sha512-u6h0sxigiR10uBzj59Y16X+KX6VD4hVZ1jGl4aCXM7ZsBngjXTKjsx5GxgrqLyx2D3juauWcBuXjfY8U4S19XQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKmOA7CXHUzHSimApAe/gaUDwkWMM66jNAvGMlOvJYswIhANb3R0fEVCbCAMV0YfXC2RTiuh/SXfoEryZT+JGf2UUh"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.15":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.15","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n2. Save on troubles and code lines with well tested, often sought functions.\n1. Immediately find printout statements by having file and function names.\n4. See the exact type of values with hidden properties and full prototype chains.\n4. Separate printouts from multiple instances by preceding with process id or host.\n3. Enhanced app portability across Linux, Mac and Windows.\n\n## Features\n\n1. Conversion of any value to printable string representation.\n2. Object manipulation methods.\n3. Portable path, number and browser-launch functions.\n4. Error and stack trace parsers and string conversions.\n5. JavaScript time value, Unix timestamp and timezone functions.\n\n# Reference\n\n### p(...), ps()\nPrintout with code location and inspect of values\n```js\nvar p = require('haraldutil').p\n\np('Printouts start with code location: file:line:function')\np('In an anonymous function, the function name is omitted')\nsomeFunction()\n\nfunction someFunction() {\n  p('Value examples:', undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:14:p 'Printouts start with code location: file:line:function'\nexamples:15:p 'In an anonymous function, the function name is omitted'\nexamples:19:someFunction 'Value examples:' undefined '1' object:Class {a: 1} function stringify() Error: a\n```\n* return value: the string\n* ps is like p, but omits the console.log\n\n### pargs(arguments)\nPrints the argument list for a function\n```js\nvar haraldutil = require('haraldutil')\nvar pargs = haraldutil.pargs\n\nLogPrinter(undefined, 'abc', {a: 1, b: 2}, new Error('a'))\n\nfunction LogPrinter() {\n  pargs(arguments)\n}\n\n```\n```\nexamples:30:LogPrinter undefined 'abc' {a: 1, b: 2} Error: a\n```\n\n### pp(...), pps()\nPrintout with code location and exhaustive inspect of values\n```js\nvar pp = require('haraldutil').pp\n\nsomeFunction()\n\nfunction someFunction() {\n  pp(console)\n}\n```\n```\nexamples:17:someFunction {\n  info: function (),\n  log: recursive-object#2,\n  error: function (),\n  time: function (label),\n  warn: recursive-object#3,\n  dir: function (object),\n  trace: function (label),\n  assert: function (expression),\n  timeEnd: function (label)\n}\n```\n* return value: the string\n* pps is like pp, but omits the console.log\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### getHomeFolder()\nGet the path to the user's home folder\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Home folder:', haraldutil.getHomeFolder())\n```\n```\nHome folder: /home/foxyboy\n```\n\n### getHomeFolder()\nGet path to a folder for temporary files\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Tmp folder:', haraldutil.getTmpFolder())\n```\nTmp folder: /home/foxyboy/tmp\n```\nif the user's home folder has a tmp, this is used. Otherwise, the systems temporary files folder is provided.\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not provide daylight savings data for timezones, but it is implemented here of the US.\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\nThis allows to compare what is earlier in the day for another timezone than localtime or utc, using the commonly available utc timevalues.\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern daylight time\n\n### CreateKey(s1, s2, ...)\nConstruct a unique string value based on the function arguments.\n```js\nvar haraldutil = require('haraldutil')\nvar dbServer = 'server'\nvar dbTable = 'table'\nvar dbTable2 = 'table2'\nvar key1 = haraldutil.createKey(dbServer, dbTable)\nvar key2 = haraldutil.createKey(dbServer, dbTable2)\nif (key1 !== key2) console.log('not the same')\n```\n```\nnot the same\n```\n\n* If any argument is not a non-empty string, exception is thrown\n* For keys to match, every string argument at their creation must have been exactly the same\n\n### periodString(num)\nprovide a human-readable string expressing a time period to two-digit precision\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('The world will come to an end in:', haraldutil.periodString(1e7))\n```\n```\nThe world will come to an end in: 2 h 46 min\n```\n\n* num: timevalue, unit: ms, positive value\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.15","dist":{"shasum":"66a967fd1130c73c4d9453af876e402051438942","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.15.tgz","integrity":"sha512-Df4Q7W/NtTcFsBaDfyQT5kwgjMexiqsDpTKm8ocmfSksoKj2wcaKziI+4UmAvsJh8UZdr6P2GhUCP25/+xJDNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcUar9F/SPpxMdfULAy+4eCLK2IU8ap8xe6PCcg9xHJwIgRPuldoMdr908xSTgrOKBSKbGtpnxFGwB7+hncreiVng="}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.16":{"name":"haraldutil","description":"Utility functions for date and logging by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.16","keywords":["timestamp","error","inspect","file","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n2. Save on troubles and code lines with well tested, often sought functions.\n1. Immediately find printout statements by having file and function names.\n4. See the exact type of values with hidden properties and full prototype chains.\n4. Separate printouts from multiple instances by preceding with process id or host.\n3. Enhanced app portability across Linux, Mac and Windows.\n\n## Features\n\n1. Conversion of any value to printable string representation.\n2. Object manipulation methods.\n3. Portable path, number and browser-launch functions.\n4. Error and stack trace parsers and string conversions.\n5. JavaScript time value, Unix timestamp and timezone functions.\n\n# Reference\n\n### p(...), ps()\nConsole.log equivalent with added leading code location\n```js\nvar p = require('haraldutil').p\n\np('Printouts start with code location: file:line:function')\np('In an anonymous function, the function name is omitted')\nsomeFunction()\n\nfunction someFunction() {\n  p('Value examples:', undefined, '1',\n    new function Class() {this.a = 1},\n    JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:15 Printouts start with code location: file:line:function\nexamples:16 In an anonymous function like here, the function name is omitted\nexamples:20:someFunction Leading string does format [object Object] NaN {\"a\":1}\nexamples:21:someFunction undefined '1' { a: 1 } [Function: stringify] [Error: a]\n```\n* return value: the string\n* ps is like p, but omits the console.log\n```js\nconsole.log('ps is p without logging, it can output location:', ps())\n```\n```\nps is p without logging, it can output location: examples:28\n```\n\n### pargs(arguments)\nPrints haraldutil.inspect of the argument list for a function\n```js\nvar haraldutil = require('haraldutil')\nvar pargs = haraldutil.pargs\n\nsomeFunction(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n\nfunction someFunction() {\n  pargs(arguments)\n}\n```\n```\nexamples:38:someFunction undefined, '1', object:Class {a: 1}, function stringify(), Error: a\n```\n\n### pPrepend(str)\npPrepend adds a lead-in to functions p, ps, pargs, q, qs, pp and pps\n```js\nvar haraldutil = require('haraldutil')\nvar p = haraldutil.p\nvar pPrepend = haraldutil.pPrepend\n\npPrepend(process.pid)\np('Launching of new process')\n\npPrepend(require('os').hostname() + ':' + process.pid)\np('Launching on new host')\n```\n```\n19854:examples:51 'Launching of new process'\nsomehostname:19854:examples:54 'Launching on new host'\n```\n* pPrepend(): removes the current prepend value\n* pPrepend(null): gets the current prepend value\n\n### q(...), qs(...)\nq and qs does a more detailed haraldutil.inspect.\n```js\nvar q = require('haraldutil').q\n\nsomeFunction()\n\nfunction someFunction() {\n  q('q and qs are like p and ps but does haraldutil.inspect rather then util.format')\n  q(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:61:someFunction 'q and qs are like p and ps but does haraldutil.inspect rather then util.format'\nexamples:62:someFunction undefined '1' object:Class {a: 1} function stringify() Error: a\n```\n\n### pp(...), pps(...)\nPrintout with code location and exhaustive inspect of values.\n```js\nvar pp = require('haraldutil').pp\n\nsomeFunction()\n\nfunction someFunction() {\n  pp(console)\n}\n```\n```\nexamples:17:someFunction {\n  info: function (),\n  log: recursive-object#2,\n  error: function (),\n  time: function (label),\n  warn: recursive-object#3,\n  dir: function (object),\n  trace: function (label),\n  assert: function (expression),\n  timeEnd: function (label)\n}\n```\n* return value: the string\n* pps is like pp, but omits the console.log\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### getHomeFolder()\nGet the path to the user's home folder\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Home folder:', haraldutil.getHomeFolder())\n```\n```\nHome folder: /home/foxyboy\n```\n\n### getTmpFolder()\nGet path to a folder for temporary files\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Tmp folder:', haraldutil.getTmpFolder())\n```\n```\nTmp folder: /home/foxyboy/tmp\n```\nif the user's home folder has a tmp, this is used. Otherwise, the systems temporary files folder is provided.\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not provide daylight savings data for timezones, but it is implemented here of the US.\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\nThis allows to compare what is earlier in the day for another timezone than localtime or utc, using the commonly available utc timevalues.\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern daylight time\n\n### CreateKey(s1, s2, ...)\nConstruct a unique string value based on the function arguments.\n```js\nvar haraldutil = require('haraldutil')\nvar dbServer = 'server'\nvar dbTable = 'table'\nvar dbTable2 = 'table2'\nvar key1 = haraldutil.createKey(dbServer, dbTable)\nvar key2 = haraldutil.createKey(dbServer, dbTable2)\nif (key1 !== key2) console.log('not the same')\n```\n```\nnot the same\n```\n\n* If any argument is not a non-empty string, exception is thrown\n* For keys to match, every string argument at their creation must have been exactly the same\n\n### periodString(num)\nprovide a human-readable string expressing a time period to two-digit precision\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('The world will come to an end in:', haraldutil.periodString(1e7))\n```\n```\nThe world will come to an end in: 2 h 46 min\n```\n\n* num: timevalue, unit: ms, positive value\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","_id":"haraldutil@0.1.16","dist":{"shasum":"286b0dcf0bb2dfb08ad75775800ef351de771d6f","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.16.tgz","integrity":"sha512-8Q0PnGjyH4jnebjtp8F2NjnBwU0xXJd2EB/K8H+RbRnhUDjJ7zNP8WXjS36tB+VToILes/u4U4anzwPnpD6aZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCICpnsJALdzrwfSaRm43x8vJD4gHj7gPsKrAoD3bjqIJ9Ah8GmCXDQAU4B2VI1zA13Y7JRP8GJ7vnIBpExVrBLF30"}]},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.17":{"name":"haraldutil","description":"App utility functions by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.17","keywords":["timestamp","error","inspect","file","stack","date","number","trace","stacktrace","util","utility","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"mochawrapper":""},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage","changelog":"git log --format=\"%ad %s\" --date=short >ChangeLog; ls -l ChangeLog"},"main":"./lib/haraldutil","readme":"# haraldutil\nUtility functions for time, errors, numbers and more.\n\n## Benefits\n\n2. Save on troubles and code lines with well tested, often sought functions.\n1. Immediately find printout statements by having file and function names.\n4. See the exact type of values with hidden properties and full prototype chains.\n4. Separate printouts from multiple instances by preceding with process id or host.\n3. Enhanced app portability across Linux, Mac and Windows.\n\n## Features\n\n1. Conversion of any value to printable string representation.\n2. Object manipulation methods.\n3. Portable path, number and browser-launch functions.\n4. Error and stack trace parsers and string conversions.\n5. JavaScript time value, Unix timestamp and timezone functions.\n\n# Reference\n\n### p(...), ps()\nConsole.log equivalent with added leading code location\n```js\nvar p = require('haraldutil').p\n\np('Printouts start with code location: file:line:function')\np('In an anonymous function, the function name is omitted')\nsomeFunction()\n\nfunction someFunction() {\n  p('Value examples:', undefined, '1',\n    new function Class() {this.a = 1},\n    JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:15 Printouts start with code location: file:line:function\nexamples:16 In an anonymous function like here, the function name is omitted\nexamples:20:someFunction Leading string does format [object Object] NaN {\"a\":1}\nexamples:21:someFunction undefined '1' { a: 1 } [Function: stringify] [Error: a]\n```\n* return value: the string\n* ps is like p, but omits the console.log\n```js\nconsole.log('ps is p without logging, it can output location:', ps())\n```\n```\nps is p without logging, it can output location: examples:28\n```\n\n### pargs(arguments)\nPrints haraldutil.inspect of the argument list for a function\n```js\nvar haraldutil = require('haraldutil')\nvar pargs = haraldutil.pargs\n\nsomeFunction(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n\nfunction someFunction() {\n  pargs(arguments)\n}\n```\n```\nexamples:38:someFunction undefined, '1', object:Class {a: 1}, function stringify(), Error: a\n```\n\n### pPrepend(str)\npPrepend adds a lead-in to functions p, ps, pargs, q, qs, pp and pps\n```js\nvar haraldutil = require('haraldutil')\nvar p = haraldutil.p\nvar pPrepend = haraldutil.pPrepend\n\npPrepend(process.pid)\np('Launching of new process')\n\npPrepend(require('os').hostname() + ':' + process.pid)\np('Launching on new host')\n```\n```\n19854:examples:51 'Launching of new process'\nsomehostname:19854:examples:54 'Launching on new host'\n```\n* pPrepend(): removes the current prepend value\n* pPrepend(null): gets the current prepend value\n\n### q(...), qs(...)\nq and qs does a more detailed haraldutil.inspect.\n```js\nvar q = require('haraldutil').q\n\nsomeFunction()\n\nfunction someFunction() {\n  q('q and qs are like p and ps but does haraldutil.inspect rather then util.format')\n  q(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:61:someFunction 'q and qs are like p and ps but does haraldutil.inspect rather then util.format'\nexamples:62:someFunction undefined '1' object:Class {a: 1} function stringify() Error: a\n```\n\n### pp(...), pps(...)\nPrintout with code location and exhaustive inspect of values.\n```js\nvar pp = require('haraldutil').pp\n\nsomeFunction()\n\nfunction someFunction() {\n  pp(console)\n}\n```\n```\nexamples:17:someFunction {\n  info: function (),\n  log: recursive-object#2,\n  error: function (),\n  time: function (label),\n  warn: recursive-object#3,\n  dir: function (object),\n  trace: function (label),\n  assert: function (expression),\n  timeEnd: function (label)\n}\n```\n* return value: the string\n* pps is like pp, but omits the console.log\n\n### inspectDeep(v)\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n### inspect(v, optsArg)\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n### inspectAll(v)\nprovide unique all-encompassing string describing value and type.\n\n### merge(o1, o2, ...)\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n### shallowClone(object)\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n### browseTo(url)\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n### getType(path1)\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n### getHomeFolder()\nGet the path to the user's home folder\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Home folder:', haraldutil.getHomeFolder())\n```\n```\nHome folder: /home/foxyboy\n```\n\n### getTmpFolder()\nGet path to a folder for temporary files\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Tmp folder:', haraldutil.getTmpFolder())\n```\n```\nTmp folder: /home/foxyboy/tmp\n```\nif the user's home folder has a tmp, this is used. Otherwise, the systems temporary files folder is provided.\n\n### parseTrace(e)\n\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n### eToString(err, trace)\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n### getLocation(opts)\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n### getLoc(s)\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n### toNumber(str, allowFloat)\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n### getTimestamp(date)\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n### getDate(timestamp)\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n### getDateString(timestamp, timezoneMinutesOffUtc, modifier)\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n### getTimevalString(...)\nSame as getDateString but for a JavaScript timeval\n\n### getISOPacific(date, offset)\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not provide daylight savings data for timezones, but it is implemented here of the US.\n\n### encodeTimeNumber(hour, minute, tzOffset)\nEncoding that allows for difference and comparison within a day for any time zone\n\nThis allows to compare what is earlier in the day for another timezone than localtime or utc, using the commonly available utc timevalues.\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern daylight time\n\n### CreateKey(s1, s2, ...)\nConstruct a unique string value based on the function arguments.\n```js\nvar haraldutil = require('haraldutil')\nvar dbServer = 'server'\nvar dbTable = 'table'\nvar dbTable2 = 'table2'\nvar key1 = haraldutil.createKey(dbServer, dbTable)\nvar key2 = haraldutil.createKey(dbServer, dbTable2)\nif (key1 !== key2) console.log('not the same')\n```\n```\nnot the same\n```\n\n* If any argument is not a non-empty string, exception is thrown\n* For keys to match, every string argument at their creation must have been exactly the same\n\n### periodString(num)\nprovide a human-readable string expressing a time period to two-digit precision\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('The world will come to an end in:', haraldutil.periodString(1e7))\n```\n```\nThe world will come to an end in: 2 h 46 min\n```\n\n* num: timevalue, unit: ms, positive value\n\n# Notes\n\n(c) [Harald Rudell](http://www.haraldrudell.com) wrote this for node in October, 2011\n\nNo warranty expressed or implied. Use at your own risk.\n\nPlease suggest better ways, new features, and possible difficulties on [github](https://github.com/haraldrudell/haraldutil)","readmeFilename":"readme.md","_id":"haraldutil@0.1.17","dist":{"shasum":"cafa28ddd49d0e5cf1bc5b223dd8e243a4d01f61","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.17.tgz","integrity":"sha512-McNZR298jhjZ3FDNfITAau4JQ95kOMtNYvgFVq+nULOhUzCTEWvSjh50VpnBEqD1YIHgw1j4b6XCFaqY27DCdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCf2ljNkbjNs7tbX549LBDM9ctl9lmA43i9Km4CCD7wawIgbUUAjXjLpEMXCNQcTf4X/4Hb/YgiaaRTMAGRRV5kvSo="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"haraldrudell","email":"harald@therudells.com"},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]},"0.1.18":{"name":"haraldutil","description":"App utility functions by Harald Rudell","author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"version":"0.1.18","keywords":["timestamp","error","inspect","file","stack","date","number","trace","stacktrace","util","utility","type"],"contributors":[{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"}],"devDependencies":{"grunt-contrib-watch":">= 0.1.4","grunts":">= 0.0.1","grunt":">= 0.4.0rc7","mochawrapper":">= 0.0.34"},"dependencies":{},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil.git"},"scripts":{"test":"mocha --ui exports --reporter spec","monitor":"mocha --ui exports --reporter min --watch","debugtest":"mocha --debug-brk --ui exports --reporter spec","coverage":"mochacoverage","changelog":"git log --format=\"%ad %s\" --date=short >ChangeLog; ls -l ChangeLog"},"main":"./lib/haraldutil","readme":"<h1>haraldutil</h1>\n<p>Utility functions for handling data types, errors, and unknown JavaScript values.</p>\n\n<h2>Benefits</h2>\n<ol>\n<li><strong>Save time and code</strong> by using well tested, commonly sought functions</li>\n<li><strong>Immediately</strong> find printout statements by having file and function names available</li>\n<li>Examine <strong>exact type</strong> of values with hidden properties and full prototype chains</li>\n<li><strong>Separate logging</strong> by multiple instances by preceding with process id or host name</li>\n<li>Enhanced <strong>app portability</strong> across Linux, Mac and Windows</li>\n</ol>\n<p>&copy; 2011, 2013 <a href=http://www.haraldrudell.com><strong>Harald Rudell</strong></a> wrote haraldutil for node in October, 2011</p>\n\n<h2>Features</h2>\n<ol>\n<li>Conversion of any value to printable string representation</li>\n<li>Object manipulation methods</li>\n<li>Portable path, number and browser-launch functions</li>\n<li>Error and stack trace parsers and string conversions</li>\n<li>JavaScript time value, Unix timestamp and timezone functions</li>\n</ol>\n\n<h1>Reference</h1>\n<h2>p(...), ps()</h2>\n<p>Console.log equivalent with added leading code location\n```js\nvar p = require('haraldutil').p\n\np('Printouts start with code location: file:line:function')\np('In an anonymous function, the function name is omitted')\nsomeFunction()\n\nfunction someFunction() {\n  p('Value examples:', undefined, '1',\n    new function Class() {this.a = 1},\n    JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:15 Printouts start with code location: file:line:function\nexamples:16 In an anonymous function like here, the function name is omitted\nexamples:20:someFunction Leading string does format [object Object] NaN {\"a\":1}\nexamples:21:someFunction undefined '1' { a: 1 } [Function: stringify] [Error: a]\n```\n</p>\n<ul>\n<li>return value: the string</li>\n<li>ps is like p, but omits the console.log</li>\n</ul>\n<p>\n```js\nconsole.log('ps is p without logging, it can output location:', ps())\n```\n```\nps is p without logging, it can output location: examples:28\n```\n</p>\n\n\n<h2>pargs(arguments)</h2>\nPrints haraldutil.inspect of the argument list for a function\n```js\nvar haraldutil = require('haraldutil')\nvar pargs = haraldutil.pargs\n\nsomeFunction(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n\nfunction someFunction() {\n  pargs(arguments)\n}\n```\n```\nexamples:38:someFunction undefined, '1', object:Class {a: 1}, function stringify(), Error: a\n```\n\n\n<h2>pPrepend(str)</h2>\npPrepend adds a lead-in to functions p, ps, pargs, q, qs, pp and pps\n```js\nvar haraldutil = require('haraldutil')\nvar p = haraldutil.p\nvar pPrepend = haraldutil.pPrepend\n\npPrepend(process.pid)\np('Launching of new process')\n\npPrepend(require('os').hostname() + ':' + process.pid)\np('Launching on new host')\n```\n```\n19854:examples:51 'Launching of new process'\nsomehostname:19854:examples:54 'Launching on new host'\n```\n* pPrepend(): removes the current prepend value\n* pPrepend(null): gets the current prepend value\n\n\n\n<h2>q(...), qs(...)</h2>\nq and qs does a more detailed haraldutil.inspect.\n```js\nvar q = require('haraldutil').q\n\nsomeFunction()\n\nfunction someFunction() {\n  q('q and qs are like p and ps but does haraldutil.inspect rather then util.format')\n  q(undefined, '1', new function Class() {this.a = 1}, JSON.stringify, new Error('a'))\n}\n```\n```\nexamples:61:someFunction 'q and qs are like p and ps but does haraldutil.inspect rather then util.format'\nexamples:62:someFunction undefined '1' object:Class {a: 1} function stringify() Error: a\n```\n\n<h2>pp(...), pps(...)</h2>\nPrintout with code location and exhaustive inspect of values.\n```js\nvar pp = require('haraldutil').pp\n\nsomeFunction()\n\nfunction someFunction() {\n  pp(console)\n}\n```\n```\nexamples:17:someFunction {\n  info: function (),\n  log: recursive-object#2,\n  error: function (),\n  time: function (label),\n  warn: recursive-object#3,\n  dir: function (object),\n  trace: function (label),\n  assert: function (expression),\n  timeEnd: function (label)\n}\n```\n* return value: the string\n* pps is like pp, but omits the console.log\n\n\n\n<h2>inspectDeep(v)</h2>\nProvides prototype chains, and unlimited strings. Abbreviates array-type properties at 10 elements.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.inspectDeep(console))\n```\n```\n{\n  info:function (),\n  log:recursive-object#2,\n  error:function (),\n  time:function (label),\n  warn:recursive-object#3,\n  dir:function (object),\n  trace:function (label),\n  assert:function (expression),\n  timeEnd:function (label)\n}\n```\n\n\n<h2>inspect(v, optsArg)</h2>\nPrints any value in a way that conveys both value and type. The value is articulate and will not contain unprintable characters.\n\n```js\nvar haraldutil = require('haraldutil')\nvar a = 'abcdefghijklm'.split('')\nconsole.log(haraldutil.inspect(a))\n```\n```\n13:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ..., 'm']\n```\nBy default, the following steps shorten the printout\n* Strings are shortened at 80 characters\n* Non-enumerable properties or prototype chains are not printed\n* Array-like properties are abbrevieted at 10 elements\n* Max 2 levels of object properties are printed\n\noptsArg\n* maxString: optional number, default 80\n* maxProperties: optional number, default 10\n* maxLevels: optional number, default 2\n* nonEnum: optional boolean, default false\n* noArrayLength: optional boolean, default true: do not print array length\n\n\n<h2>inspectAll(v)</h2>\nprovide unique all-encompassing string describing value and type.\n\n<h2>clone(o1)</h2>\n<p>Clone an object and its enumerable properties</p>\n<ul><li>o: value of array, object and primitive properties</li></ol>\n\n<p>Array, Date and RegExp instances are cloned.\nother objects becomes Object objects, ie. Function, Error etc.\nnon-enumerable properties, getters and setters are not copied\n</p>\n\n\n<h2>merge(o1, o2, ...)</h2>\nCreate an object constructed using the enumerable properties of all provided arguments.\n\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.merge({a: 1}, {a: 2, b: 2}, {c: 3}))\n```\n```\n{ a: 2, b: 2, c: 3 }\n```\n* same name properties from later objects overwrite\n* return value: Object object with only enumerable properties\n\n\n\n<h2>shallowClone(object)</h2>\nCreate a shallow copy of an object\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Any value works:', haraldutil.shallowClone(undefined))\nvar o = {a: 'unchanged'}\nvar o1 = haraldutil.shallowClone(o)\no1.a = 'changed'\nconsole.log('o:', o)\n```\n```\nAny value works: {}\no: { a: 'unchanged' }\n```\n\n\n\n<h2>browseTo(url)</h2>\nOpens the system default browser, or a new tab in the active browser window, displaying the location url.\n```js\nrequire('haraldutil').browseTo('http://google.com').on('exit', function (code) {\n\tif (code) console.log('Failed with exit code:' + code)\n})\n```\n\n<h2>getType(path1)</h2>\nDetermine what path1 is, an improved to fs.exists function.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Type:', haraldutil.getType('/home'))\n```\n```\nType: 1\n```\nreturn value:\n\n* undefined: path1 does not exist\n* 1: path1 is a directory\n* true: path1 is a file\n\n\n<h2>getHomeFolder()</h2>\nGet the path to the user's home folder\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Home folder:', haraldutil.getHomeFolder())\n```\n```\nHome folder: /home/foxyboy\n```\n\n\n<h2>getTmpFolder()</h2>\nGet path to a folder for temporary files\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('Tmp folder:', haraldutil.getTmpFolder())\n```\n```\nTmp folder: /home/foxyboy/tmp\n```\nif the user's home folder has a tmp, this is used. Otherwise, the systems temporary files folder is provided.\n\n\n<h2>parseTrace(e)</h2>\nIf e is an Error object that has a stack trace, the parsed stack trace is returned as an object. Otherwise undefined is returned.\n```js\nvar haraldutil = require('haraldutil')\nvar s = haraldutil.parseTrace(new Error)\nif (s) console.log(s.frames[0])\n```\n```\n{ text: 'parseTrace (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:40:31)',\n  folder: '/home/foxyboy/Desktop/c505/node/haraldutil/test/examples',\n  file: 'examples.js',\n  line: 40,\n  column: 31,\n  func: 'parseTrace' }\n```\nreturn value: object or undefined\n* .message: string: the leading error message\n* .frames: array of object: captured stack traces\n\nEach frame in the frames array\n* .func: optional string: Object.function expression in the code\n* .as: optional string: function name if different from property name\n* .folder: optional string: if a folder other than current directory, then the absolute path to folder where source file is located, '/home/user'\n* .file: optional string: source file name, 'script.js'\n* .line: optional number: 10\n* .column optional number: 5\n* .source: optional string: text that may appear instead of file and folder, eg. 'unknown source'\n* .text: string: this frame as text. contains no newlines and has the leading at removed\n\n<h2>eToString(err, trace)</h2>\nmake an Error object printable\n```js\nvar haraldutil = require('haraldutil')\ntry {\n\tJSON.parse('que')\n} catch (e) {\n\tconsole.log(haraldutil.eToString(e))\n}\n```\nNote the type property that JSON.parse adds to the Error object:\n```\nSyntaxError: Unexpected token q\n    at Object.parse (native)\n    at eToString (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:52:7)\n    at demonstrate (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:70:2)\n    at /home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:61:2\n    at Array.forEach (native)\n    at Object.<anonymous> (/home/foxyboy/Desktop/c505/node/haraldutil/test/examples/examples.js:60:7)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\ntype: 'unexpected_token'\n```\n* e: Error object\n* trace: optional boolean: false: do not include the stack trace\n* return value: printable string\n\n\n\n<h2>getLocation(opts)</h2>\nGets the current script executing location as a string.\n```js\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getLocation())\n```\n```\nfunction: demonstrate file: examples.js:61:2 folder: /home/foxyboy/Desktop/c505/node/haraldutil/test/examples\n```\n* opts: optional object\n* .offset: offset in the stack for lcoation\n* .err: optional Error object\n* .object: optional boolean: false: do not prepend object and * method, eg. Module.load\n* .folder: optional boolean: false: do not include file folder\n* .fileline: true: no column, no fileheader\n* .dropExt: remove extention from filename\n* .addAfterFile: string\n\nreturn value: printable string\n* empty string on troubles\n\n\n\n<h2>getLoc(s)</h2>\nGets location as file:line\n```js\n// example.js\nvar haraldutil = require('haraldutil')\nfuncName()\nfunction funcName() {\n  // next line is line 6\n  console.log(haraldutil.getLoc(arguments.callee.name), 'Hello')\n}\n```\n```\nexample:6:funcName Hello\n```\n* s: optional string\n\n\n\n<h2>toNumber(str, allowFloat)</h2>\nparse numbers, NaN if trailing non-numeric characters\n\n* str: string: format: [+-]0-9..[.0-9..]\n* allowFloat: optional boolean: allow decimal part, default no\n* leading and trailing whitespace and line terminators are allowed\n* unparseable numbers return NaN\n\nThis function is similar to parseFloat, but does not accept trailing garbage characters.\n\n<h2>getTimestamp(date)</h2>\nconvert Date to a unix timestamp number.\n\n* date: optional Date, default now\n\n<h2>getDate(timestamp)</h2>\nconvert a unix timestamp number to Date.\n\n* timestamp: number: Unix epoch\n* return value: Date object\n\n<h2>getDateString(timestamp, timezoneMinutesOffUtc, modifier)</h2>\nConvert unix timestamp to string like '2011-09-30T23:21-0400'\n\n* timestamp: optional number: unix timestamp, default: now\n* timezoneMinutesOffUtc: optional number: minutes off utc, negative west of London, -240 for NY\n* modifier: optional number: 1: skip date part, 2: skip date and timezone\n\n<h2>getTimevalString(...)</h2>\nSame as getDateString but for a JavaScript timeval\n\n<h2>getISOPacific(date, offset)</h2>\nPrint an ISO8601 string adjusted for US daylight savings\n```\nvar haraldutil = require('haraldutil')\nconsole.log(haraldutil.getISOPacific())\n```\n```\n2012-07-01T02:00-08\n```\n\n* date a Date object, default now\n* offset number, minutes from utc, default -420 (Pacific standard time)\n\nNote that JavaScript does not provide daylight savings data for timezones, but it is implemented here of the US.\n\n<h2>encodeTimeNumber(hour, minute, tzOffset)</h2>\nEncoding that allows for difference and comparison within a day for any time zone\n\nThis allows to compare what is earlier in the day for another timezone than localtime or utc, using the commonly available utc timevalues.\n\n* hour, minute: number: base time 0-23, 0-59\n* tzOffset: offset from base location in minutes for result\n* if base is in utc timezone and tzOffset is -240, result will be in eastern daylight time\n\n<h2>createKey(s1, s2, ...)</h2>\nConstruct a unique string value based on the function arguments.\n```js\nvar haraldutil = require('haraldutil')\nvar dbServer = 'server'\nvar dbTable = 'table'\nvar dbTable2 = 'table2'\nvar key1 = haraldutil.createKey(dbServer, dbTable)\nvar key2 = haraldutil.createKey(dbServer, dbTable2)\nif (key1 !== key2) console.log('not the same')\n```\n```\nnot the same\n```\n\n* If any argument is not a non-empty string, exception is thrown\n* For keys to match, every string argument at their creation must have been exactly the same\n\n<h2>periodString(num)</h2>\nprovide a human-readable string expressing a time period to two-digit precision\n```js\nvar haraldutil = require('haraldutil')\nconsole.log('The world will come to an end in:', haraldutil.periodString(1e7))\n```\n```\nThe world will come to an end in: 2 h 46 min\n```\n\n* num: timevalue, unit: ms, positive value\n\n<h1>Notes</h1>\n<p>Please suggest better ways, new features, and possible difficulties on <a href=https://github.com/haraldrudell/haraldutil>github</a></p>\n<p>&copy; 2011, 2013 <a href=http://www.haraldrudell.com><strong>Harald Rudell</strong></a> wrote haraldutil for node in October, 2011</p>\n","readmeFilename":"readme.md","_id":"haraldutil@0.1.18","dist":{"shasum":"0df65b8fe2a2ce7422ace6c80ba4785239595d1e","tarball":"https://registry.npmjs.org/haraldutil/-/haraldutil-0.1.18.tgz","integrity":"sha512-Z6fvJ1prRsfIeqYa4XPKzl+WBdmG5xgwv3yMe297T8j3D60e2IgKmSceBv5nh2bH43gKES2ims36b4QHlVdjmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnCjLDtzz6YzyKugFK1Eq6XANi5IptSjxGuz2dG6eLlgIgPqLyEILe2aoU4vI5y5DJRAlgi0KKBIIFkArW1BSa15g="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"haraldrudell","email":"harald@therudells.com"},"maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}]}},"readme":"","maintainers":[{"name":"haraldrudell","email":"harald@therudells.com"}],"time":{"modified":"2022-06-18T19:20:51.138Z","created":"2012-04-15T05:22:34.317Z","0.0.4":"2012-04-15T05:22:35.764Z","0.0.5":"2012-04-24T03:13:51.392Z","0.0.6":"2012-07-23T23:24:33.760Z","0.0.7":"2012-08-20T01:23:13.247Z","0.0.8":"2012-08-21T22:55:14.673Z","0.0.9":"2012-08-27T04:17:19.049Z","0.0.10":"2012-08-27T07:39:17.214Z","0.0.11":"2012-08-27T11:40:53.201Z","0.0.12":"2012-08-28T01:03:23.903Z","0.0.13":"2012-09-03T08:30:56.529Z","0.1.0":"2012-09-03T23:31:26.130Z","0.1.1":"2012-09-03T23:44:34.500Z","0.1.2":"2012-09-03T23:49:53.105Z","0.1.3":"2012-09-04T00:17:03.531Z","0.1.5":"2012-09-04T01:59:26.217Z","0.1.6":"2012-09-10T06:12:08.058Z","0.1.7":"2012-09-28T19:18:25.614Z","0.1.8":"2012-12-22T06:52:54.866Z","0.1.9":"2012-12-22T07:31:32.083Z","0.1.10":"2012-12-22T07:41:15.524Z","0.1.11":"2012-12-25T08:32:17.475Z","0.1.12":"2012-12-25T23:05:22.985Z","0.1.13":"2012-12-25T23:15:52.849Z","0.1.14":"2012-12-29T23:48:20.660Z","0.1.15":"2013-01-06T23:42:42.346Z","0.1.16":"2013-01-12T08:24:01.649Z","0.1.17":"2013-01-16T10:24:04.642Z","0.1.18":"2013-02-02T21:49:11.559Z"},"repository":{"type":"git","url":"https://github.com/haraldrudell/haraldutil.git"},"author":{"name":"Harald Rudell","email":"harald@allgoodapps.com","url":"http://www.haraldrudell.com"},"users":{"fgribreau":true}}