🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

gradient-string

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gradient-string

Beautiful color gradients in terminal output

3.0.0
latest
Version published
Weekly downloads
836K
-7.46%
Maintainers
0
Weekly downloads
 
Created

What is gradient-string?

The gradient-string npm package allows you to create colorful gradients in your terminal output. It supports multiple gradient styles and can be used to enhance the visual appeal of CLI applications.

What are gradient-string's main functionalities?

Basic Gradient

This feature allows you to apply a basic gradient to a string. The example uses the 'rainbow' gradient to colorize the text 'Hello, World!'.

const gradient = require('gradient-string');
console.log(gradient.rainbow('Hello, World!'));

Custom Gradient

This feature allows you to create a custom gradient by specifying an array of colors. The example creates a gradient from red to green to blue and applies it to the text 'Custom Gradient!'.

const gradient = require('gradient-string');
const customGradient = gradient(['#FF0000', '#00FF00', '#0000FF']);
console.log(customGradient('Custom Gradient!'));

Multiline Gradient

This feature allows you to apply a gradient to multiline text. The example uses a gradient from cyan to pink and applies it to the text 'Multiline Gradient!'.

const gradient = require('gradient-string');
const multiline = gradient('cyan', 'pink');
console.log(multiline.multiline('Multiline
Gradient!'));

Animation

This feature allows you to create animated gradient text. The example animates the text 'Animating...' with a rainbow gradient.

const gradient = require('gradient-string');
const { animateString } = require('gradient-string');
const animation = animateString('Animating...', { gradient: 'rainbow' });
setInterval(() => console.log(animation()), 100);

Other packages similar to gradient-string

FAQs

Package last updated on 27 Sep 2024

Did you know?

Socket

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.

Install

Related posts