Comparing version 1.0.66 to 2.0.0
{ | ||
"name": "acho", | ||
"description": "An extremely simple (but powerful) logging system for NodeJS and browser.", | ||
"version": "1.0.6", | ||
"version": "2.0.0", | ||
"authors": [ | ||
"Kiko Beats josefrancisco.verdu@gmail.com" | ||
"Kiko Beats josefrancisco.verdu@gmail.com" | ||
], | ||
@@ -23,3 +23,6 @@ "ignore": [ | ||
"main": "dist/acho.js", | ||
"repository": "Kikobeats/acho" | ||
"repository": "Kikobeats/acho", | ||
"author": { | ||
"name": "Kiko Beats" | ||
} | ||
} |
188
CHANGELOG.md
@@ -1,41 +0,189 @@ | ||
# Change Log | ||
<a name="2.0.0"></a> | ||
# 2.0.0 (2015-07-31) | ||
## [1.0.5](https://github.com/Kikobeats/acho/tree/1.0.5) (2015-05-09) | ||
[Full Changelog](https://github.com/Kikobeats/acho/compare/1.0.4...1.0.5) | ||
* avoid avoid colorize messages in production under NodeJS | ||
([f6d2d54](https://github.com/kikobeats/acho/commit/f6d2d54)) | ||
* colors by default | ||
([103194b](https://github.com/kikobeats/acho/commit/103194b)) | ||
* documentation refactor | ||
([bc43872](https://github.com/kikobeats/acho/commit/bc43872)) | ||
* expose generateMessage | ||
([57c3b9f](https://github.com/kikobeats/acho/commit/57c3b9f)) | ||
* little refactor. | ||
([4046677](https://github.com/kikobeats/acho/commit/4046677)) | ||
* Update README.md | ||
([fd0acee](https://github.com/kikobeats/acho/commit/fd0acee)) | ||
* updated | ||
([2bec971](https://github.com/kikobeats/acho/commit/2bec971)) | ||
* updated bumped settings | ||
([3025456](https://github.com/kikobeats/acho/commit/3025456)) | ||
## [1.0.4](https://github.com/Kikobeats/acho/tree/1.0.4) (2015-03-19) | ||
[Full Changelog](https://github.com/Kikobeats/acho/compare/1.0.3...1.0.4) | ||
## [1.0.3](https://github.com/Kikobeats/acho/tree/1.0.3) (2015-03-19) | ||
<a name="1.0.8"></a> | ||
## 1.0.8 (2015-06-14) | ||
[Full Changelog](https://github.com/Kikobeats/acho/compare/1.0.2...1.0.3) | ||
**Merged pull requests:** | ||
* 1.0.8 releases | ||
([6e56dac](https://github.com/kikobeats/acho/commit/6e56dac)) | ||
* use options.messages if is available | ||
([19aff24](https://github.com/kikobeats/acho/commit/19aff24)) | ||
- Usability/compatibility changes \(more info inside\) [\#4](https://github.com/Kikobeats/acho/pull/4) ([clocklear](https://github.com/clocklear)) | ||
## [1.0.2](https://github.com/Kikobeats/acho/tree/1.0.2) (2015-03-17) | ||
[Full Changelog](https://github.com/Kikobeats/acho/compare/1.0.1...1.0.2) | ||
<a name="1.0.7"></a> | ||
## 1.0.7 (2015-05-30) | ||
## [1.0.1](https://github.com/Kikobeats/acho/tree/1.0.1) (2015-03-16) | ||
[Full Changelog](https://github.com/Kikobeats/acho/compare/1.0.0...1.0.1) | ||
* 1.0.7 releases | ||
([2e5f011](https://github.com/kikobeats/acho/commit/2e5f011)) | ||
* improved log level function generation | ||
([0ad83a5](https://github.com/kikobeats/acho/commit/0ad83a5)) | ||
* updated | ||
([809217b](https://github.com/kikobeats/acho/commit/809217b)) | ||
**Merged pull requests:** | ||
- Grammar and styling corrections [\#3](https://github.com/Kikobeats/acho/pull/3) ([saelfaer](https://github.com/saelfaer)) | ||
- Add chalk modifiers to message type [\#2](https://github.com/Kikobeats/acho/pull/2) ([terox](https://github.com/terox)) | ||
<a name="1.0.6"></a> | ||
## 1.0.6 (2015-05-10) | ||
## [1.0.0](https://github.com/Kikobeats/acho/tree/1.0.0) (2015-03-14) | ||
**Closed issues:** | ||
* 1.0.6 releases | ||
([a1ac35a](https://github.com/kikobeats/acho/commit/a1ac35a)) | ||
* deleted unnecessary code | ||
([72c10f4](https://github.com/kikobeats/acho/commit/72c10f4)) | ||
* updated | ||
([3f36779](https://github.com/kikobeats/acho/commit/3f36779)) | ||
- Cannot find module 'coffee-script' [\#1](https://github.com/Kikobeats/acho/issues/1) | ||
<a name="1.0.5"></a> | ||
## 1.0.5 (2015-05-09) | ||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* | ||
* 1.0.4 releases | ||
([e4bcef2](https://github.com/kikobeats/acho/commit/e4bcef2)) | ||
* 1.0.5 releases | ||
([448ea4e](https://github.com/kikobeats/acho/commit/448ea4e)) | ||
* first commit | ||
([99c44a4](https://github.com/kikobeats/acho/commit/99c44a4)) | ||
* Update README.md | ||
([330b4d0](https://github.com/kikobeats/acho/commit/330b4d0)) | ||
* update warning message into warn | ||
([5c1654d](https://github.com/kikobeats/acho/commit/5c1654d)) | ||
<a name="1.0.4"></a> | ||
## 1.0.4 (2015-03-19) | ||
* fixed extra space | ||
([11d2c1e](https://github.com/kikobeats/acho/commit/11d2c1e)) | ||
<a name="1.0.3"></a> | ||
## 1.0.3 (2015-03-19) | ||
* 1.0.3 releases | ||
([193f234](https://github.com/kikobeats/acho/commit/193f234)) | ||
* because mac is not a real os | ||
([e636ce2](https://github.com/kikobeats/acho/commit/e636ce2)) | ||
* linus torvalds is crying for this | ||
([f4eff0f](https://github.com/kikobeats/acho/commit/f4eff0f)) | ||
* Merge pull request #4 from clocklear/master | ||
([4cfdb40](https://github.com/kikobeats/acho/commit/4cfdb40)) | ||
* Switched to titleize for propercase | ||
([45a9bfd](https://github.com/kikobeats/acho/commit/45a9bfd)) | ||
* Update README.md | ||
([1082a73](https://github.com/kikobeats/acho/commit/1082a73)) | ||
* Update README.md | ||
([78407bb](https://github.com/kikobeats/acho/commit/78407bb)) | ||
* Update README.md | ||
([88e415d](https://github.com/kikobeats/acho/commit/88e415d)) | ||
* Update README.md | ||
([9b04cb2](https://github.com/kikobeats/acho/commit/9b04cb2)) | ||
* updated | ||
([8c52aec](https://github.com/kikobeats/acho/commit/8c52aec)) | ||
* Updated README.md to include UMD blurb | ||
([f05d703](https://github.com/kikobeats/acho/commit/f05d703)) | ||
<a name="1.0.2"></a> | ||
## 1.0.2 (2015-03-17) | ||
* 1.0.2 releases | ||
([fa3b7d1](https://github.com/kikobeats/acho/commit/fa3b7d1)) | ||
* Fix example.html, export proper module name to global space | ||
([f6ef959](https://github.com/kikobeats/acho/commit/f6ef959)) | ||
* refactor | ||
([1786df2](https://github.com/kikobeats/acho/commit/1786df2)) | ||
* Removed makefile, added npm script for build | ||
([c441376](https://github.com/kikobeats/acho/commit/c441376)) | ||
* Update README.md | ||
([c61aeb7](https://github.com/kikobeats/acho/commit/c61aeb7)) | ||
* updated | ||
([c217034](https://github.com/kikobeats/acho/commit/c217034)) | ||
* updated mocha reference to local dependency | ||
([7fc622c](https://github.com/kikobeats/acho/commit/7fc622c)) | ||
* Usability changes. Added a makefile for quick task execution. Added component.json so that we can ([9e73dd4](https://github.com/kikobeats/acho/commit/9e73dd4)) | ||
<a name="1.0.1"></a> | ||
## 1.0.1 (2015-03-16) | ||
* 1.0.1 releases | ||
([7b1f9e8](https://github.com/kikobeats/acho/commit/7b1f9e8)) | ||
* added support for styles | ||
([775e84a](https://github.com/kikobeats/acho/commit/775e84a)) | ||
* fixed | ||
([5a37063](https://github.com/kikobeats/acho/commit/5a37063)) | ||
* fixed browserify build and little improvements | ||
([c72b67d](https://github.com/kikobeats/acho/commit/c72b67d)) | ||
* Grammar and styling corrections | ||
([d703e87](https://github.com/kikobeats/acho/commit/d703e87)) | ||
* Merge branch 'master' of github.com:Kikobeats/acho | ||
([c9d3998](https://github.com/kikobeats/acho/commit/c9d3998)) | ||
* Merge pull request #3 from saelfaer/patch-1 | ||
([76d4b66](https://github.com/kikobeats/acho/commit/76d4b66)) | ||
* Update README.md | ||
([45f08d6](https://github.com/kikobeats/acho/commit/45f08d6)) | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2015-03-14) | ||
* completed | ||
([8d01b7d](https://github.com/kikobeats/acho/commit/8d01b7d)) | ||
* completed | ||
([5b73e9e](https://github.com/kikobeats/acho/commit/5b73e9e)) | ||
* first commit | ||
([edac5ab](https://github.com/kikobeats/acho/commit/edac5ab)) | ||
* fixed url | ||
([9b4d611](https://github.com/kikobeats/acho/commit/9b4d611)) | ||
* merged | ||
([222e72d](https://github.com/kikobeats/acho/commit/222e72d)) | ||
* refactor and updated documentation | ||
([6824d6a](https://github.com/kikobeats/acho/commit/6824d6a)) | ||
* Update README.md | ||
([1194cfa](https://github.com/kikobeats/acho/commit/1194cfa)) | ||
* updated | ||
([14b3639](https://github.com/kikobeats/acho/commit/14b3639)) | ||
* updated | ||
([2a5d5f7](https://github.com/kikobeats/acho/commit/2a5d5f7)) | ||
* updated | ||
([1c12565](https://github.com/kikobeats/acho/commit/1c12565)) | ||
* updated | ||
([68b5472](https://github.com/kikobeats/acho/commit/68b5472)) | ||
/** | ||
* acho - An extremely simple (but powerful) logging system for NodeJS and browser. | ||
* @version v1.0.6 | ||
* @version v2.0.0 | ||
* @link https://github.com/Kikobeats/acho | ||
* @license MIT | ||
*/!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Acho=e()}}(function(){return function e(t,r,n){function o(s,u){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!u&&c)return c(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){var r=t[s][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t){"use strict";var r,n,o;o=e("chalk"),n=e("./Default"),t.exports=r=function(){function e(e){null==e&&(e={}),this.color=e.color||n.COLOR,this.level=e.level||n.LEVEL,this.types=e.types||n.TYPES,this.print=e.print||n.PRINT,this.muted=e.muted||n.MUTED,this.messages=function(e){return function(){var t,r;t={};for(r in e.types)t[r]=[];return t}}(this)(),this.outputType=e.outputType||n.OUTPUT_TYPE,this.outputMessage=e.outputMessage||n.OUTPUT_MESSAGE}return e.DEFAULT=n,e.prototype.push=function(e,t){return this.messages[e].push(t),this},e.prototype.add=function(e,t){return this[e](t),this.push(e,t),this},e.prototype.error=function(e){return this.printLine("error",e),this},e.prototype.warn=function(e){return this.printLine("warn",e),this},e.prototype.success=function(e){return this.printLine("success",e),this},e.prototype.info=function(e){return this.printLine("info",e),this},e.prototype.verbose=function(e){return this.printLine("verbose",e),this},e.prototype.debug=function(e){return this.printLine("debug",e),this},e.prototype.silly=function(e){return this.printLine("silly",e),this},e.prototype.isPrintable=function(e){return this.level===this.muted?!1:this.types[e].level<=this.types[this.level].level},e.prototype.colorize=function(e,t){var r,n,i,s;if(!this.color)return t;for(e=e.split(" "),s=o,n=0,i=e.length;i>n;n++)r=e[n],s=s[r];return s(t)},e.prototype.printLine=function(e,t){var r,n;if(this.isPrintable(e))return r=this.types[e].color,n=this.outputType(e),n=this.colorize(r,n),t=this.outputMessage(t),t=this.colorize(this.types.line.color,t),console.log(n+t)},e}()},{"./Default":2,chalk:5}],2:[function(e,t){"use strict";t.exports={OUTPUT_TYPE:function(e){return e+" : "},OUTPUT_MESSAGE:function(e){return e},PRINT:function(){var e,t,r;t=[];for(r in this.types)t.push(function(){var t,n,o,i;for(o=this.messages[r],i=[],t=0,n=o.length;n>t;t++)e=o[t],i.push(this.printLine(r,e));return i}.call(this));return t},LEVEL:"info",COLOR:!1,MUTED:"silent",TYPES:{line:{color:"gray"},error:{level:0,color:"red"},warn:{level:1,color:"yellow"},success:{level:2,color:"green"},info:{level:3,color:"white"},verbose:{level:4,color:"cyan"},debug:{level:5,color:"blue"},silly:{level:6,color:"magenta"}}}},{}],3:[function(){},{}],4:[function(e,t){function r(){if(!s){s=!0;for(var e,t=i.length;t;){e=i,i=[];for(var r=-1;++r<t;)e[r]();t=i.length}s=!1}}function n(){}var o=t.exports={},i=[],s=!1;o.nextTick=function(e){i.push(e),s||setTimeout(r,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=n,o.addListener=n,o.once=n,o.off=n,o.removeListener=n,o.removeAllListeners=n,o.emit=n,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],5:[function(e,t){(function(r){"use strict";function n(e){this.enabled=e&&void 0!==e.enabled?e.enabled:p}function o(e){var t=function r(){return i.apply(r,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=g,t}function i(){var e=arguments,t=e.length,r=0!==t&&String(arguments[0]);if(t>1)for(var n=1;t>n;n++)r+=" "+e[n];if(!this.enabled||!r)return r;for(var o=this._styles,i=o.length;i--;){var s=c[o[i]];r=s.open+r.replace(s.closeRe,s.open)+s.close}return r}function s(){var e={};return Object.keys(h).forEach(function(t){e[t]={get:function(){return o.call(this,[t])}}}),e}var u=e("escape-string-regexp"),c=e("ansi-styles"),l=e("strip-ansi"),f=e("has-ansi"),p=e("supports-color"),a=Object.defineProperties;"win32"===r.platform&&(c.blue.open="[94m");var h=function(){var e={};return Object.keys(c).forEach(function(t){c[t].closeRe=new RegExp(u(c[t].close),"g"),e[t]={get:function(){return o.call(this,this._styles.concat(t))}}}),e}(),g=a(function(){},h);a(n.prototype,s()),t.exports=new n,t.exports.styles=c,t.exports.hasColor=f,t.exports.stripColor=l,t.exports.supportsColor=p}).call(this,e("_process"))},{_process:4,"ansi-styles":6,"escape-string-regexp":7,"has-ansi":8,"strip-ansi":10,"supports-color":12}],6:[function(e,t){"use strict";var r=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};r.colors.grey=r.colors.gray,Object.keys(r).forEach(function(e){var t=r[e];Object.keys(t).forEach(function(e){var n=t[e];r[e]=t[e]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(r,e,{value:t,enumerable:!1})})},{}],7:[function(e,t){"use strict";var r=/[|\\{}()[\]^$+*?.]/g;t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(r,"\\$&")}},{}],8:[function(e,t){"use strict";var r=e("ansi-regex"),n=new RegExp(r().source);t.exports=n.test.bind(n)},{"ansi-regex":9}],9:[function(e,t){"use strict";t.exports=function(){return/(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g}},{}],10:[function(e,t){"use strict";var r=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(r,""):e}},{"ansi-regex":11}],11:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],12:[function(e,t){(function(e){"use strict";var r=e.argv;t.exports=function(){return"FORCE_COLOR"in e.env?!0:-1!==r.indexOf("--no-color")||-1!==r.indexOf("--no-colors")||-1!==r.indexOf("--color=false")?!1:-1!==r.indexOf("--color")||-1!==r.indexOf("--colors")||-1!==r.indexOf("--color=true")||-1!==r.indexOf("--color=always")?!0:e.stdout&&!e.stdout.isTTY?!1:"UPSTART_JOB"in e.env?!1:"win32"===e.platform?!0:"COLORTERM"in e.env?!0:"dumb"===e.env.TERM?!1:/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(e.env.TERM)?!0:!1}()}).call(this,e("_process"))},{_process:4}],Acho:[function(e,t){"use strict";e("coffee-script/register"),t.exports=e("./lib/Acho")},{"./lib/Acho":1,"coffee-script/register":3}]},{},[])("Acho")}); | ||
*/!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Acho=e()}}(function(){return function e(t,n,r){function o(i,u){if(!n[i]){if(!t[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(s)return s(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var a=n[i]={exports:{}};t[i][0].call(a.exports,function(e){var n=t[i][1][e];return o(n?n:e)},a,a.exports,e,t,n,r)}return n[i].exports}for(var s="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(e,t,n){(function(n){"use strict";var r,o,s,i=function(e,t){return function(){return e.apply(t,arguments)}};s=e("chalk"),o=e("./Default"),t.exports=r=function(){function e(e){null==e&&(e={}),this.generateTypeMessage=i(this.generateTypeMessage,this),this.color=e.color||o.COLOR,this.level=e.level||o.UNMUTED,this.types=e.types||o.TYPES,this.print=e.print||o.PRINT,this.messages=function(t){return function(){var n,r,o;n={};for(o in t.types)n[o]=(null!=(r=e.messages)?r[o]:void 0)||[],"line"!==o&&(t[o]=t.generateTypeMessage(o));return n}}(this)(),this.outputType=e.outputType||o.OUTPUT_TYPE,this.outputMessage=e.outputMessage||o.OUTPUT_MESSAGE,this.generateMessage=e.generateMessage||o.GENERATE_MESSAGE}return e.prototype.push=function(e,t){return this.messages[e].push(t),this},e.prototype.add=function(e,t){return this[e](t),this.push(e,t),this},e.prototype.colorize=function(e,t){var r,o,i,u;if(!this.color||"production"===("undefined"!=typeof n&&null!==n?n.env.NODE_ENV:void 0))return t;for(e=e.split(" "),u=s,o=0,i=e.length;i>o;o++)r=e[o],u=u[r];return u(t)},e.prototype.isPrintable=function(e){return this.level===o.UNMUTED?!0:this.level===o.MUTED?!1:this.types[e].level<=this.types[this.level].level},e.prototype.generateTypeMessage=function(e,t){return function(t){return function(n){return console.log(t.generateMessage(e,n)),t}}(this)},e}()}).call(this,e("_process"))},{"./Default":2,_process:4,chalk:5}],2:[function(e,t,n){"use strict";t.exports={PRINT:function(){var e,t,n;t=[];for(n in this.types)t.push(function(){var t,r,o,s;for(o=this.messages[n],s=[],t=0,r=o.length;r>t;t++)e=o[t],s.push(console.log(this.generateMessage(n,e)));return s}.call(this));return t},OUTPUT_MESSAGE:function(e){return e},OUTPUT_TYPE:function(e){return e+" : "},GENERATE_MESSAGE:function(e,t){var n,r;if(this.isPrintable(e))return n=this.types[e].color,r=this.outputType(e),r=this.colorize(n,r),t=this.outputMessage(t),t=this.colorize(this.types.line.color,t),r+t},COLOR:!0,UNMUTED:"all",MUTED:"silent",TYPES:{line:{color:"gray"},error:{level:0,color:"red"},warn:{level:1,color:"yellow"},success:{level:2,color:"green"},info:{level:3,color:"white"},verbose:{level:4,color:"cyan"},debug:{level:5,color:"blue"},silly:{level:6,color:"magenta"}}}},{}],3:[function(e,t,n){},{}],4:[function(e,t,n){function r(){a=!1,u.length?l=u.concat(l):f=-1,l.length&&o()}function o(){if(!a){var e=setTimeout(r);a=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u[f].run();f=-1,t=l.length}u=null,a=!1,clearTimeout(e)}}function s(e,t){this.fun=e,this.array=t}function i(){}var u,c=t.exports={},l=[],a=!1,f=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new s(e,t)),1!==l.length||a||setTimeout(o,0)},s.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],5:[function(e,t,n){(function(n){"use strict";function r(e){this.enabled=e&&void 0!==e.enabled?e.enabled:f}function o(e){var t=function n(){return s.apply(n,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=h,t}function s(){var e=arguments,t=e.length,n=0!==t&&String(arguments[0]);if(t>1)for(var r=1;t>r;r++)n+=" "+e[r];if(!this.enabled||!n)return n;for(var o=this._styles,s=o.length;s--;){var i=c[o[s]];n=i.open+n.replace(i.closeRe,i.open)+i.close}return n}function i(){var e={};return Object.keys(g).forEach(function(t){e[t]={get:function(){return o.call(this,[t])}}}),e}var u=e("escape-string-regexp"),c=e("ansi-styles"),l=e("strip-ansi"),a=e("has-ansi"),f=e("supports-color"),p=Object.defineProperties;"win32"===n.platform&&(c.blue.open="[94m");var g=function(){var e={};return Object.keys(c).forEach(function(t){c[t].closeRe=new RegExp(u(c[t].close),"g"),e[t]={get:function(){return o.call(this,this._styles.concat(t))}}}),e}(),h=p(function(){},g);p(r.prototype,i()),t.exports=new r,t.exports.styles=c,t.exports.hasColor=a,t.exports.stripColor=l,t.exports.supportsColor=f}).call(this,e("_process"))},{_process:4,"ansi-styles":6,"escape-string-regexp":7,"has-ansi":8,"strip-ansi":10,"supports-color":12}],6:[function(e,t,n){"use strict";var r=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};r.colors.grey=r.colors.gray,Object.keys(r).forEach(function(e){var t=r[e];Object.keys(t).forEach(function(e){var n=t[e];r[e]=t[e]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(r,e,{value:t,enumerable:!1})})},{}],7:[function(e,t,n){"use strict";var r=/[|\\{}()[\]^$+*?.]/g;t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(r,"\\$&")}},{}],8:[function(e,t,n){"use strict";var r=e("ansi-regex"),o=new RegExp(r().source);t.exports=o.test.bind(o)},{"ansi-regex":9}],9:[function(e,t,n){"use strict";t.exports=function(){return/(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g}},{}],10:[function(e,t,n){"use strict";var r=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(r,""):e}},{"ansi-regex":11}],11:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],12:[function(e,t,n){(function(e){"use strict";var n=e.argv;t.exports=function(){return"FORCE_COLOR"in e.env?!0:-1!==n.indexOf("--no-color")||-1!==n.indexOf("--no-colors")||-1!==n.indexOf("--color=false")?!1:-1!==n.indexOf("--color")||-1!==n.indexOf("--colors")||-1!==n.indexOf("--color=true")||-1!==n.indexOf("--color=always")?!0:e.stdout&&!e.stdout.isTTY?!1:"win32"===e.platform?!0:"COLORTERM"in e.env?!0:"dumb"===e.env.TERM?!1:/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(e.env.TERM)?!0:!1}()}).call(this,e("_process"))},{_process:4}],Acho:[function(e,t,n){"use strict";e("coffee-script/register"),t.exports=e("./lib/Acho")},{"./lib/Acho":1,"coffee-script/register":3}]},{},[])("Acho")}); |
{ | ||
"name": "acho", | ||
"version": "1.0.66", | ||
"version": "2.0.0", | ||
"description": "An extremely simple (but powerful) logging system for NodeJS and browser.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -7,2 +7,3 @@ # acho | ||
![Last version](https://img.shields.io/github/tag/Kikobeats/acho.svg?style=flat-square) | ||
[![Build Status](http://img.shields.io/travis/Kikobeats/acho/master.svg?style=flat)](https://travis-ci.org/Kikobeats/acho) | ||
@@ -55,3 +56,3 @@ [![Dependency status](http://img.shields.io/david/Kikobeats/acho.svg?style=flat)](https://david-dm.org/Kikobeats/acho) | ||
var Acho = require('acho'); | ||
var acho = new Acho({color: true}); | ||
var acho = new Acho(); | ||
``` | ||
@@ -62,3 +63,3 @@ | ||
```js | ||
var acho = new Acho({color: true}); | ||
var acho = new Acho(); | ||
``` | ||
@@ -111,23 +112,5 @@ | ||
You can also modify the print method! | ||
```js | ||
acho.print = function() { | ||
// You are in the acho scope, so you can use the properties | ||
// of the object. Check the API documentation. | ||
console.log(); | ||
var _this = this; | ||
Object.keys(this.types).forEach(function(type) { | ||
_this.messages[type].forEach(function(message) { | ||
_this.printLine(type, message); | ||
}); | ||
}); | ||
}; | ||
``` | ||
You can completely customize the library to your requirements: changes colors, add more types, sort the priorities... the internal structure of the object is public and you can edit it dynamically. **You have the power**. | ||
### Defining the level | ||
Establishing the loglevel is a good way to filter out undesired information from output. The available levels are: | ||
Establishing the loglevel is a good way to filter out undesired information from output. The available levels by default are: | ||
@@ -141,5 +124,9 @@ - `error`: Display calls to `.error()` messages. | ||
- `silly`: Display calls from `.error()`, `.warn()`, `success()`, `info()`, `verbose()`, `debug()`, `silly()` messages. | ||
Additionally exists two special levels: | ||
- `silent`: Avoid all output. | ||
- `all`: Allow print all message types. | ||
The default log level is `info`. You can define it in the the constructor: | ||
The default log level is `all`. You can define it in the constructor: | ||
@@ -158,8 +145,8 @@ ```js | ||
You can completely customize the library to your requirements: changes colors, add more types, sort the priorities... the internal structure of the object is public and you can edit it dynamically. **You have the power**. | ||
By default the messages structure is brief: Just the message type followed by the message itself. | ||
But you can easily modify the output. For example, let's add a timestamp to each message. | ||
But you can easily modify the output. For example, let's add a timestamp to each message: | ||
To customize the output we offer two methods, `outputType` and `outputMessage`: | ||
```js | ||
@@ -169,2 +156,4 @@ acho = new Acho({ | ||
level: 'silly', | ||
// Customize how to print the 'type' of each message | ||
outputType: function(type) { | ||
@@ -174,2 +163,4 @@ return '[' + type + '] »'; | ||
// Customize how to print the message. | ||
// Add things before and/or after. | ||
outputMessage: function(message) { | ||
@@ -188,5 +179,4 @@ return Date() + ' :: ' + message; | ||
You can modify the outputted message at any time. | ||
If you need customize more the output you can setup `.print` `.generateMessage` (see below) that are a more low level methods for generate and print the output message. | ||
## API | ||
@@ -199,10 +189,9 @@ | ||
- color **{Boolean}**: Enable or disable colorized output. `false` by default. | ||
- level **{String}**: Provides the logging level. `info` by default. | ||
- level **{String}**: Provides the logging level. `all` by default. | ||
- types **{Object}**: You can provide the types and priorities. | ||
- print **{Function}**: Provides a function to print the messages. | ||
- muted **{String}**: Determines the log level to avoid output messages. `silent` by default. | ||
- print **{Function}**: Provides a function that determines how to print the messages. By default uses `.generateMessage` for generate the mesage that will be outputted. | ||
- outputType **{Function}**: Provides a function to customize the type in the output. | ||
- outputMessage **{Function}**: Provides a function to customize the message in the output. | ||
- generateMessage **{Function}**: Provides a function that generate the message to be outputted. It combines other internal methods for generate the output (as `.isPrintable` or `.colorize`) and normally you are not interested in the definition of it, but you can provide it as option as well. | ||
### .push({String} <type>, {String} <message>) | ||
@@ -216,30 +205,8 @@ | ||
### .error({String} <message>) | ||
For each level you have a function following the pattern: | ||
Output a `error` message. | ||
### .\[loglevel\]({String} <message>) | ||
### .warn({String} <message>) | ||
For each log level that you declared in the constructor (or the default log levels provides by the library if you don't declare nothing) will be created a function with the same name to output a message with these log level. | ||
Output a `warn` message. | ||
### .success({String} <message>) | ||
Output a `success` message. | ||
### .info({String} <message>) | ||
Output a `info` message. | ||
### .verbose({String} <message>) | ||
Output a `verbose` message. | ||
### .debug({String} <message>) | ||
Output a `debug` message. | ||
### .silly({String} <message>) | ||
Output a `silly` message. | ||
### .isPrintable({String} <type>) | ||
@@ -253,12 +220,4 @@ | ||
### .printLine({String} <type> {String} <message>) | ||
Combine `.isPrintable` and `.colorize` to print a line correctly. | ||
### .print() | ||
Default loop to print the messages that are stored internally. By default it uses `.printLine` in each message iteration. | ||
## License | ||
MIT © [Kiko Beats](http://www.kikobeats.com) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32504
22
53
212