Auto COMMIT for build : 69 \n commit by: Administrator <gitlab_admin_873017@example.com> \n with message : Update .gitlab-ci.yml file
This commit is contained in:
commit
fe8be012ad
|
@ -0,0 +1,42 @@
|
|||
# @d3v4pp/Colors.
|
||||
[](https://cvs.d3v4pp.fr/D3V4PP/colors.git)
|
||||
[](https://discord.gg/kH9gXA)
|
||||
[](https://www.npmjs.com/package/@d3v4pp/colors)
|
||||
|
||||
Putting colors in terminal is an interesting idea bit,
|
||||
what if the user dosent have a terminal that manage colors or have only 16 or 8 colors when you used a 256 colors logger or some other things ..
|
||||
|
||||
you will see text like this in your terminal
|
||||
~~~
|
||||
22m 1.83 KiB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
|
||||
~~~
|
||||
|
||||
##### This package will allow you to add colors to your terminal application with auto terminal detection and adaptation of colors
|
||||
##### You will be able to use 255 colors code in Basics terminals
|
||||
##### Coloration will have no effect on terminals that dosent manage colors
|
||||
#### Try it its simple and easy to use
|
||||
|
||||
|
||||
[](https://www.npmjs.com/package/@d3v4pp/colors)
|
||||
|
||||
## Installation
|
||||
~~~
|
||||
npm install @d3v4pp/colors --save
|
||||
~~~
|
||||
|
||||
## How to use it
|
||||
#### Using Colors instance methodes
|
||||
~~~javascript
|
||||
const Colors = require('@d3v4pp/colors');
|
||||
console.log(Colors.color("text to log",[0..255]));
|
||||
console.log(Colors.bgColor("text to log",[0..255]));
|
||||
console.log(Colors.bgColor( Colors.color("text to log",[0..255]) , [0..255] ));
|
||||
~~~
|
||||
|
||||
#### Using String.prototype
|
||||
~~~javascript
|
||||
const Colors = require('@d3v4pp/colors');
|
||||
console.log("text to log".color([o..255]) );
|
||||
console.log("text to log".bgColor([0..255]));
|
||||
console.log("text to log".color([0..255]).bgColor([0..255])));
|
||||
~~~
|
|
@ -0,0 +1 @@
|
|||
(()=>{var r={18:r=>{"use strict";r.exports=require("tty")},44:(r,e,t)=>{r.exports=t(672)},545:(r,e,t)=>{const s=t(611);r.exports=new class{constructor(){this.has256=s.stdout.has256,this.has16=s.stdout.has16m,this.hasBasic=s.stdout.hasBasic}isBasic(){return this.hasBasic}is16(){return this.has16}is256(){return this.has256}isTrue(){return this.is256()}isAnyColor(){return this.has256||this.has16||this.hasBasic}__forceBasic(){this.has256=!1,this.has16=!1,this.hasBasic=!0}__force16(){this.has256=!1,this.has16=!0,this.hasBasic=!0}__force256(){this.has256=!0,this.has16=!0,this.hasBasic=!0}}},611:(r,e,t)=>{"use strict";const s=t(857),o=t(18),i=(r,e=process.argv)=>{const t=r.startsWith("-")?"":1===r.length?"-":"--",s=e.indexOf(t+r),o=e.indexOf("--");return-1!==s&&(-1===o||s<o)},{env:n}=process;let a;function c(r){return 0!==r&&{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function l(r,e){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(r&&!e&&void 0===a)return 0;const t=a||0;if("dumb"===n.TERM)return t;if("win32"===process.platform){const r=s.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((r=>r in n))||"codeship"===n.CI_NAME?1:t;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in n)return 1;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const r=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:t}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in n&&(a="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),r.exports={supportsColor:function(r){return c(l(r,r&&r.isTTY))},stdout:c(l(!0,o.isatty(1))),stderr:c(l(!0,o.isatty(2)))}},672:(r,e,t)=>{const s=t(545),o=t(992),i=t(733);r.exports=new class{constructor(){this.checker=s,this.enabled=this.checker.isAnyColor(),this.checker.isAnyColor()?this.enabled=!0:(console.warn("Terminal stdout does not supports 256 color"),this.enabled=!1);let r=this;this.__addPropertyToStringClass({color:function(e){return r.color(this.valueOf(),e)}}),this.__addPropertyToStringClass({bgColor:function(e){return r.bgColor(this.valueOf(),e)}}),this.newLineRegex=new RegExp(/[\r\n]+/g)}desable(){this.enabled=!1}enable(){this.enabled=!0}strip(r){return(""+r).replace(/\x1B\[\d+m/g,"")}__addPropertyToStringClass(r){Object.assign(String.prototype,r)}color(r,e){return this.checker.has256?this.color256(r,e):this.checker.has16?this.color16(r,e):this.checker.hasBasic?this.colorBasic(r,e):r}colorBasic(r,e){let t=r;return Object.getOwnPropertyNames(o).map(((s,i)=>{o[s].indexOf(e)>=0&&(t="[3"+i+"m"+r+"[0m")})),t}color16(r,e){let t=r;return Object.getOwnPropertyNames(i).map(((s,o)=>{i[s].indexOf(e)>=0&&(t="[3"+o+";1m"+r+"[0m")})),t}color256(r,e){return"[38;5;"+e+"m"+r+"[0m"}bgColor(r,e){return this.checker.has256?this.bgColor256(r,e):this.checker.has16?this.bgColor16(r,e):this.checker.hasBasic?this.bgColorBasic(r,e):r}bgColorBasic(r,e){let t=r;return Object.getOwnPropertyNames(o).map(((s,i)=>{o[s].indexOf(e)>=0&&(t="[4"+i+"m"+r+"[0m")})),t}bgColor16(r,e){let t=r;return Object.getOwnPropertyNames(i).map(((s,o)=>{i[s].indexOf(e)>=0&&(t="[4"+o+";1m"+r+"[0m")})),t}bgColor256(r,e){return"[48;5;"+e+"m"+r+"[0m"}showColorsCodes(){if(this.enabled)for(let r=0;r<256;r++)console.log(this.bgColor(" "+r+" ",r)+"")}}},733:r=>{r.exports={black:[0,232,233,234,235,236,237,238,239,240],red:[1],green:[2],yellow:[3],blue:[4],magenta:[5],cyan:[6],white:[7],bblack:[8],bred:[9],bgreen:[2],byellow:[],bblue:[],bmagenta:[],bcyan:[],bwhite:[],reset:[]}},857:r=>{"use strict";r.exports=require("os")},992:r=>{r.exports={black:[0,232,233,234,235,236,237,238,239,240],red:[1],green:[2],yellow:[3],blue:[4],magenta:[5],cyan:[6],white:[7],reset:[0]}}},e={},t=function t(s){var o=e[s];if(void 0!==o)return o.exports;var i=e[s]={exports:{}};return r[s](i,i.exports,t),i.exports}(44);module.exports=t})();
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "@d3v4pp/colors",
|
||||
"version": "0.0.3",
|
||||
"description": "256 colors for your node.js console",
|
||||
"main": "index.js",
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://cvs.d3v4pp.fr/D3V4PP/colors.git"
|
||||
},
|
||||
"author": {
|
||||
"name": "Ayoub Hassani <D3v4pp>",
|
||||
"email": "ayoub@d3v4pp.fr",
|
||||
"url": "https://d3v4pp.fr/"
|
||||
},
|
||||
"funding": "https://paypal.me/SupportTheDoc",
|
||||
"homepage": "https://cvs.d3v4pp.fr/D3V4PP/colors/src/master/README.md",
|
||||
"bugs": {
|
||||
"url": "https://cvs.d3v4pp.fr/D3V4PP/colors/issues",
|
||||
"email": "ayoub@d3v4pp.fr"
|
||||
},
|
||||
"license": "d3v4pp",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"terminal",
|
||||
"colors"
|
||||
],
|
||||
"devDependencies": {}
|
||||
}
|
Loading…
Reference in New Issue