fancy-node-logger
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,1 +0,1 @@ | ||
(()=>{"use strict";var t={506:(t,e,r)=>{const s=r(242);class u{static TYPE={NOTE:"NOTE",INFO:"INFO",SUCCESS:"SUCCESS",WARNING:"WARNING",ERROR:"ERROR"};parseMessages=(...t)=>{switch(t?.length){case 1:return[t[0]];case 2:return[t[0],null,t[1]];case 3:return[t[0],t[1],t[2]];default:return[]}};getDefaultSeverityStyle=t=>{switch(t){case u.TYPE.NOTE:return["bgWhite","black"];case u.TYPE.INFO:return["bgBlueBright","black"];case u.TYPE.SUCCESS:return["bgGreenBright","black"];case u.TYPE.WARNING:return["bgYellowBright","black"];case u.TYPE.ERROR:return["bgRedBright","black"];default:return["bgWhite","black"]}};getDefaultTitleStyle=t=>{switch(t){case u.TYPE.NOTE:return["white"];case u.TYPE.INFO:return["blueBright"];case u.TYPE.SUCCESS:return["greenBright"];case u.TYPE.WARNING:return["yellowBright"];case u.TYPE.ERROR:return["redBright"];default:return["white"]}};formatText=(t,e)=>{if(!t)return"";if(!e||e?.length<1)return t;let r=s;return e?.forEach((t=>r=r?.[t])),r?r("",t,""):t};print=(t,e,r,s,u,i)=>{const a=this.formatText(t,e),E=a?`${a} `:"",n=this.formatText(r,s),o=n?`${n} `:"",l=this.formatText(u,i),c=l?`\n${l}\n`:"";console.log(`${E}${o}${c}`)};output=(t,...e)=>{const[r,s,u]=this.parseMessages(...e);this.print(r,this.getDefaultSeverityStyle(t),s,this.getDefaultTitleStyle(t),u)};note=(...t)=>{this.output(u.TYPE.NOTE,"NOTE",...t)};verbose=(...t)=>{this.output(u.TYPE.NOTE,"VERBOSE",...t)};info=(...t)=>{this.output(u.TYPE.INFO,"INFO",...t)};success=(...t)=>{this.output(u.TYPE.SUCCESS,"SUCCESS",...t)};done=(...t)=>{this.output(u.TYPE.SUCCESS,"DONE",...t)};warning=(...t)=>{this.output(u.TYPE.WARNING,"WARNING",...t)};error=(...t)=>{this.output(u.TYPE.ERROR,"ERROR",...t)};failure=(...t)=>{this.output(u.TYPE.ERROR,"FAILURE",...t)}}t.exports=new u},242:t=>{t.exports=require("chalk")}},e={},r=function r(s){var u=e[s];if(void 0!==u)return u.exports;var i=e[s]={exports:{}};return t[s](i,i.exports,r),i.exports}(506),s=exports;for(var u in r)s[u]=r[u];r.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var t={506:(t,e,r)=>{const s=r(242);class u{static TYPE={NOTE:"NOTE",INFO:"INFO",SUCCESS:"SUCCESS",WARNING:"WARNING",ERROR:"ERROR"};parseMessages=(...t)=>{switch(t?.length){case 1:return[t[0]];case 2:return[t[0],null,t[1]];case 3:return[t[0],t[1],t[2]];default:return[]}};getDefaultSeverityStyle=t=>{switch(t){case u.TYPE.NOTE:return["bgWhite","black"];case u.TYPE.INFO:return["bgBlueBright","black"];case u.TYPE.SUCCESS:return["bgGreenBright","black"];case u.TYPE.WARNING:return["bgYellowBright","black"];case u.TYPE.ERROR:return["bgRedBright","black"];default:return["bgWhite","black"]}};getDefaultTitleStyle=t=>{switch(t){case u.TYPE.NOTE:return["white"];case u.TYPE.INFO:return["blueBright"];case u.TYPE.SUCCESS:return["greenBright"];case u.TYPE.WARNING:return["yellowBright"];case u.TYPE.ERROR:return["redBright"];default:return["white"]}};formatText=(t,e)=>{if(!t)return"";if(!e||e?.length<1)return t;let r=s;return e?.forEach((t=>r=r?.[t])),r?r("",t,""):t};print=(t,e,r,s,u,i)=>{const a=this.formatText(t,e),E=a?`${a} `:"",n=this.formatText(r,s),o=n?`${n} `:"",l=this.formatText(u,i),c=l?`${n?"\n":""}${l}\n`:"";console.log(`${E}${o}${c}`)};output=(t,...e)=>{const[r,s,u]=this.parseMessages(...e);this.print(r,this.getDefaultSeverityStyle(t),s,this.getDefaultTitleStyle(t),u)};note=(...t)=>{this.output(u.TYPE.NOTE,"NOTE",...t)};verbose=(...t)=>{this.output(u.TYPE.NOTE,"VERBOSE",...t)};info=(...t)=>{this.output(u.TYPE.INFO,"INFO",...t)};success=(...t)=>{this.output(u.TYPE.SUCCESS,"SUCCESS",...t)};done=(...t)=>{this.output(u.TYPE.SUCCESS,"DONE",...t)};warning=(...t)=>{this.output(u.TYPE.WARNING,"WARNING",...t)};error=(...t)=>{this.output(u.TYPE.ERROR,"ERROR",...t)};failure=(...t)=>{this.output(u.TYPE.ERROR,"FAILURE",...t)}}t.exports=new u},242:t=>{t.exports=require("chalk")}},e={},r=function r(s){var u=e[s];if(void 0!==u)return u.exports;var i=e[s]={exports:{}};return t[s](i,i.exports,r),i.exports}(506),s=exports;for(var u in r)s[u]=r[u];r.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})(); |
{ | ||
"name": "fancy-node-logger", | ||
"author": "liangxiaojun", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Fancy logger in Node with Chalk", | ||
@@ -23,5 +23,6 @@ "main": "./dist/index.js", | ||
"keywords": [ | ||
"NodeJs", | ||
"Logger", | ||
"Chalk" | ||
"node", | ||
"nodeJs", | ||
"logger", | ||
"chalk" | ||
], | ||
@@ -28,0 +29,0 @@ "license": "MIT", |
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
6010