Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gradient-string

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

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
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
519K
increased by8.1%
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

Keywords

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

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