New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

beautify-console-log

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beautify-console-log - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

2

dist/index.js

@@ -1,2 +0,2 @@

!function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.BeautifyConsole=o():t.BeautifyConsole=o()}(self,(()=>(()=>{"use strict";var t={943:(t,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BeautifyConsole=void 0;const e={black:90,red:91,green:92,yellow:93,blue:94,purple:95,cyan:96,white:97},r=(t={},o,r)=>{const{color:s="white",bgColor:i="white"}=t,n=e[i]||0,l=e[s]||0;return"object"==typeof process&&"node"===process.title?`[${n+10};${l};1m ${r.toUpperCase()}  ${o}`:`[${n+10};${l};1m ${r.toUpperCase()}  ${o}`},s={info:(t="beautify-console-log ",o={bgColor:"blue",color:"white"})=>[r(o,t,"info")],error:(t="beautify-console-log ",o={bgColor:"red",color:"white"})=>[r(o,t,"error")],warn:(t="beautify-console-log ",o={bgColor:"yellow",color:"black"})=>[r(o,t,"warn")],log:(t="beautify-console-log ",o={bgColor:"green",color:"white"})=>[r(o,t,"log")]},i="info",n="warn",l="error",a="log";class h{constructor(){this.infoPadStartText=s[i](),this.errorPadStartText=s[l](),this.warnPadStartText=s[n](),this.logPadStartText=s[a](),this.info=console.info.bind(this,...this.infoPadStartText),this.error=console.error.bind(this,...this.errorPadStartText),this.warn=console.warn.bind(this,...this.warnPadStartText),this.log=console.log.bind(this,...this.logPadStartText)}static getInstance(){return this.instance||(this.instance=new h),this.instance}config(t){const{type:o=[i,l,n,a],title:e}=t;o.length>0&&(this.setShowLog(!1),o.forEach((t=>this.setShowLog(!0,t)))),e&&o.forEach((t=>this.setPadStartText({logType:t,title:e})))}setShowLog(t,o){const e={info:()=>{this.info=t?console.info.bind(this,...this.infoPadStartText):(...t)=>{}},error:()=>{this.error=t?console.error.bind(this,...this.errorPadStartText):(...t)=>{}},warn:()=>{this.warn=t?console.warn.bind(this,...this.warnPadStartText):(...t)=>{}},log:()=>{this.log=t?console.log.bind(this,...this.logPadStartText):(...t)=>{}}};o?e[o]?e[o]():console.error(`type:${o} not supported`):t?(this.info=console.info.bind(this,...this.infoPadStartText),this.error=console.error.bind(this,...this.errorPadStartText),this.warn=console.warn.bind(this,...this.warnPadStartText),this.log=console.log.bind(this,...this.logPadStartText)):(this.info=(...t)=>{},this.error=(...t)=>{},this.warn=(...t)=>{},this.log=(...t)=>{})}reset(){return this.setShowLog(!0),this}open(t){return this.setShowLog(!0,t),this}close(t){return this.setShowLog(!1,t),this}setPadStartText(t){try{const o={info:()=>{this.info=console.info.bind(this,...s[i](t.title,t.style))},error:()=>{this.error=console.error.bind(this,...s[l](t.title,t.style))},warn:()=>{this.warn=console.warn.bind(this,...s[n](t.title,t.style))},log:()=>{this.log=console.log.bind(this,...s[a](t.title,t.style))}};o[t.logType]?o[t.logType]():console.error(`type:${t.logType} not supported`)}catch(t){this.error(t)}return this}}o.BeautifyConsole=h}},o={};function e(r){var s=o[r];if(void 0!==s)return s.exports;var i=o[r]={exports:{}};return t[r](i,i.exports,e),i.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0});const o=e(943);t.default=o.BeautifyConsole})(),r})()));
!function(o,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BeautifyConsole=e():o.BeautifyConsole=e()}(self,(()=>(()=>{"use strict";var o={943:(o,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BeautifyConsole=void 0;const r=t(377),i=(o={},e,t)=>{const{color:i=r.ColorType.white,bgColor:s=r.ColorType.white}=o,n=(s||0)+10,l=i||0;return"object"==typeof process&&"node"===process.title?`[${n};${l};1m ${t.toUpperCase()}  ${e}`:`[${n};${l};1m ${t.toUpperCase()}  ${e}`},s={info:(o="beautify-console-log ",e={bgColor:r.ColorType.blue,color:r.ColorType.white})=>[i(e,o,r.LogType.info)],error:(o="beautify-console-log ",e={bgColor:r.ColorType.red,color:r.ColorType.white})=>[i(e,o,r.LogType.error)],warn:(o="beautify-console-log ",e={bgColor:r.ColorType.yellow,color:r.ColorType.black})=>[i(e,o,r.LogType.warn)],log:(o="beautify-console-log ",e={bgColor:r.ColorType.green,color:r.ColorType.white})=>[i(e,o,r.LogType.log)]};class n{constructor(){this.infoPadStartText=s[r.LogType.info](),this.errorPadStartText=s[r.LogType.error](),this.warnPadStartText=s[r.LogType.warn](),this.logPadStartText=s[r.LogType.log](),this.info=console.info.bind(this,...this.infoPadStartText),this.error=console.error.bind(this,...this.errorPadStartText),this.warn=console.warn.bind(this,...this.warnPadStartText),this.log=console.log.bind(this,...this.logPadStartText)}static getInstance(){return this.instance||(this.instance=new n),this.instance}config(o){const{type:e=[r.LogType.info,r.LogType.error,r.LogType.warn,r.LogType.log],title:t}=o;e.length>0&&(this.setShowLog(!1),e.forEach((o=>this.setShowLog(!0,o)))),t&&e.forEach((o=>this.setPadStartText({logType:o,title:t})))}setShowLog(o,e){const t={info:()=>{this.info=o?console.info.bind(this,...this.infoPadStartText):(...o)=>{}},error:()=>{this.error=o?console.error.bind(this,...this.errorPadStartText):(...o)=>{}},warn:()=>{this.warn=o?console.warn.bind(this,...this.warnPadStartText):(...o)=>{}},log:()=>{this.log=o?console.log.bind(this,...this.logPadStartText):(...o)=>{}}};e?t[e]?t[e]():console.error(`type:${e} not supported`):o?(this.info=console.info.bind(this,...this.infoPadStartText),this.error=console.error.bind(this,...this.errorPadStartText),this.warn=console.warn.bind(this,...this.warnPadStartText),this.log=console.log.bind(this,...this.logPadStartText)):(this.info=(...o)=>{},this.error=(...o)=>{},this.warn=(...o)=>{},this.log=(...o)=>{})}reset(){return this.setShowLog(!0),this}open(o){return this.setShowLog(!0,o),this}close(o){return this.setShowLog(!1,o),this}setPadStartText(o){try{const e={info:()=>{this.info=console.info.bind(this,...s[r.LogType.info](o.title,o.style))},error:()=>{this.error=console.error.bind(this,...s[r.LogType.error](o.title,o.style))},warn:()=>{this.warn=console.warn.bind(this,...s[r.LogType.warn](o.title,o.style))},log:()=>{this.log=console.log.bind(this,...s[r.LogType.log](o.title,o.style))}};e[o.logType]?e[o.logType]():console.error(`type:${o.logType} not supported`)}catch(o){this.error(o)}return this}}e.BeautifyConsole=n},377:(o,e)=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.LogType=e.ColorType=void 0,function(o){o[o.black=90]="black",o[o.red=91]="red",o[o.green=92]="green",o[o.yellow=93]="yellow",o[o.blue=94]="blue",o[o.purple=95]="purple",o[o.cyan=96]="cyan",o[o.white=97]="white"}(t||(e.ColorType=t={})),function(o){o.info="info",o.warn="warn",o.error="error",o.log="log"}(r||(e.LogType=r={}))}},e={};function t(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return o[r](s,s.exports,t),s.exports}var r={};return(()=>{var o=r;Object.defineProperty(o,"__esModule",{value:!0});const e=t(943);o.default=e.BeautifyConsole})(),r})()));
//# sourceMappingURL=index.js.map
{
"name": "beautify-console-log",
"version": "1.2.3",
"version": "1.2.4",
"description": "This is a further beautification and encapsulation of the 'console' object, including console. log, console. info, console. warn, and console. error. It can display the number of rows where the log is printed.",

@@ -9,2 +9,3 @@ "keywords": [

"log",
"logger",
"console",

@@ -23,3 +24,5 @@ "console log",

"控制台日志美化",
"console.log美化"
"console.log美化",
"console美化",
"console调试"
],

@@ -34,3 +37,3 @@ "main": "dist/index.js",

"builddev": "cross-env NODE_ENV=development npx webpack --mode=development",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",

@@ -37,0 +40,0 @@ "prepare": "npm run build",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc