Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
ansi-colors-nestable
Advanced tools
Enables nested coloring of texts using ansi-colors.
$ npm install ansi-colors-nestable --save-dev
const nestableColors = require('ansi-colors-nestable');
const ansiColors = require('ansi-colors');
const blue = nestableColors('blue');
const red = nestableColors(ansi.red);
blue('This package ', red('nested'), ' coloring of texts');
Returns a function which accepts multiple argument texts and colors each of them with color. If an argument text is already colored, that color is given precedence. As a result, this function make coloring nestable.
This function uses the package ansi-colors inside for supporting Node.js >= v0.10. So color names need to be supported by ansi-colors.
Parameter | Type | Description |
---|---|---|
color | string or function | color name or coloring function |
A coloring function which can colorize multiple argument texts.
Type: function
The API of this returned function is as follows:
color**(...texts): string**
Parameters:
Parameter | Type | Description |
---|---|---|
texts | string(s) | texts to be colored. |
Returned:
A colored and concatenated text
Type: string
This function has the same API with a returned function from nestableColors and simply returned a concatenated text of argument strings without coloring.
Parameter | Type | Description |
---|---|---|
texts | string(s) | texts to be colored. |
A concatenated text without coloring.
Type: string
Copyright (C) 2017 Takayuki Sato
This program is free software under MIT License. See the file LICENSE in this distribution for more details.
FAQs
Enables nested coloring of texts
We found that ansi-colors-nestable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.