eight-colors
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -1,1 +0,1 @@ | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("eight-colors",[],o):"object"==typeof exports?exports["eight-colors"]=o():e["eight-colors"]=o()}(self,(()=>{return e={329:e=>{const o=["black","red","green","yellow","blue","magenta","cyan","white"],r={};let t=!1;Object.defineProperty(r,"disabled",{get:function(){return t},set:function(e){t=e}});const n=(e,o,r)=>t?o:`[${e}m${o}[${r}m`;o.forEach(((e,o)=>{r[e]=e=>n(`3${o}`,e,"39")})),r.bg={},o.forEach(((e,o)=>{r.bg[e]=e=>n(`4${o}`,e,"49")})),r.br={},o.forEach(((e,o)=>{r.br[e]=e=>n(`9${o}`,e,"39")})),r.br.bg={},o.forEach(((e,o)=>{r.br.bg[e]=e=>n(`10${o}`,e,"49")})),r.reset=e=>n("0",e,"0"),r.bold=e=>n("1",e,"21"),r.faint=e=>n("2",e,"22"),r.italic=e=>n("3",e,"23"),r.underline=e=>n("4",e,"24"),r.inverse=e=>n("7",e,"27"),r.hidden=e=>n("8",e,"28"),r.strike=e=>n("9",e,"29"),r.remove=e=>`${e}`.replace(/\033\[(\d+)m/g,""),r.log=function(e){arguments.length>1&&(e=Array.from(arguments).join(" ")),console.log(e)},o.forEach((e=>{const o=`log${e.charAt(0).toUpperCase()}${e.slice(1)}`;r[o]=function(){const o=Array.from(arguments),t=(0,r[e])(r.remove(o.join(" ")));return r.log(t),t}})),e.exports=r},379:(e,o,r)=>{const t=r(329);e.exports=t}},o={},function r(t){var n=o[t];if(void 0!==n)return n.exports;var c=o[t]={exports:{}};return e[t](c,c.exports,r),c.exports}(379);var e,o})); | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("eight-colors",[],o):"object"==typeof exports?exports["eight-colors"]=o():e["eight-colors"]=o()}(self,(()=>{return e={329:e=>{const o=["black","red","green","yellow","blue","magenta","cyan","white"],r={},{env:t={},argv:n=[]}="undefined"==typeof process?{}:process,c="NO_COLOR"in t||n.includes("--no-color"),i="FORCE_COLOR"in t||n.includes("--color");let s=!1;(c||i)&&(s=!0),Object.defineProperty(r,"disabled",{get:function(){return s},set:function(e){s=e}});const f=(e,o,r)=>s?o:`[${e}m${o}[${r}m`;o.forEach(((e,o)=>{r[e]=e=>f(`3${o}`,e,"39")})),r.bg={},o.forEach(((e,o)=>{r.bg[e]=e=>f(`4${o}`,e,"49")})),r.br={},o.forEach(((e,o)=>{r.br[e]=e=>f(`9${o}`,e,"39")})),r.br.bg={},o.forEach(((e,o)=>{r.br.bg[e]=e=>f(`10${o}`,e,"49")})),r.reset=e=>f("0",e,"0"),r.bold=e=>f("1",e,"21"),r.faint=e=>f("2",e,"22"),r.italic=e=>f("3",e,"23"),r.underline=e=>f("4",e,"24"),r.inverse=e=>f("7",e,"27"),r.hidden=e=>f("8",e,"28"),r.strike=e=>f("9",e,"29"),r.remove=e=>`${e}`.replace(/\033\[(\d+)m/g,""),r.log=function(e){arguments.length>1&&(e=Array.from(arguments).join(" ")),console.log(e)},o.forEach((e=>{const o=`log${e.charAt(0).toUpperCase()}${e.slice(1)}`;r[o]=function(){const o=Array.from(arguments),t=(0,r[e])(r.remove(o.join(" ")));return r.log(t),t}})),e.exports=r},379:(e,o,r)=>{const t=r(329);e.exports=t}},o={},function r(t){var n=o[t];if(void 0!==n)return n.exports;var c=o[t]={exports:{}};return e[t](c,c.exports,r),c.exports}(379);var e,o})); |
@@ -10,3 +10,17 @@ // https://en.wikipedia.org/wiki/ANSI_escape_code | ||
const { | ||
env = {}, | ||
argv = [] | ||
} = typeof process === 'undefined' ? {} : process; | ||
const isDisabled = 'NO_COLOR' in env || argv.includes('--no-color'); | ||
const isForced = 'FORCE_COLOR' in env || argv.includes('--color'); | ||
let _disabled = false; | ||
if (isDisabled) { | ||
_disabled = true; | ||
} else if (isForced) { | ||
_disabled = true; | ||
} | ||
Object.defineProperty(EC, 'disabled', { | ||
@@ -13,0 +27,0 @@ get: function() { |
{ | ||
"name": "eight-colors", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Eight colors for the console", | ||
@@ -35,6 +35,6 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"eslint": "^8.56.0", | ||
"eslint-config-plus": "^1.0.6", | ||
"eslint-plugin-html": "^8.0.0" | ||
"eslint": "^9.11.0", | ||
"eslint-config-plus": "^2.0.2", | ||
"eslint-plugin-html": "^8.1.1" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # Eight Colors | ||
## Features | ||
* Eight Colors: black, red, green, yellow, blue, magenta, cyan, white | ||
* Eight Colors: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white` | ||
* Background and Bright | ||
@@ -17,2 +17,7 @@ * Styles: reset, bold, faint, italic, underline, inverse, hidden, strike | ||
* Log colors | ||
* ESM/CJS | ||
* TypeScript | ||
* env `NO_COLOR` `FORCE_COLOR` and flags `--no-color` `--color` | ||
* 0 dependencies | ||
* 2.6K Size | ||
@@ -148,29 +153,1 @@ | ||
- [https://handwiki.org/wiki/ANSI_escape_code](https://handwiki.org/wiki/ANSI_escape_code) | ||
## CHANGELOG | ||
* 1.3.0 | ||
- added `disabled` property, defaults to `false` | ||
* 1.2.1 | ||
- fixed types for commonjs | ||
* 1.2.0 | ||
- remove useless logColor | ||
* 1.1.1 | ||
- fixed types | ||
* 1.1.0 | ||
- added types | ||
* 1.0.3 | ||
- fixed API multiple arguments | ||
* 1.0.2 | ||
- added browser bundle | ||
* 1.0.1 | ||
- added log color API | ||
* 1.0.0 |
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
10919
154
151