Een uitbreiding op chalk
npm install chalk-extraChalk Extra is an enhanced version of the popular chalk library, providing additional predefined styles, gradients, ASCII art, animations, and spinners to make your terminal output more vibrant and expressive.
- Predefined Styles: A variety of text styles, including rainbow, zebra, trap, and neon colors.
- Gradients: Use the gradient-string library to create stunning text gradients.
- ASCII Art: Generate ASCII art using the figlet library.
- Animations: Add text animations with chalk-animation.
- Spinners: Display terminal spinners using the ora library.
- Custom Styles: Easily add your own custom styles.
Install Chalk Extra via npm:
``bash`
npm install chalk-extra
Import Chalk Extra into your project and start using its features:
`javascript
import chalk from 'chalk-extra';
// Predefined styles
console.log(chalk.rainbow('Rainbow Text'));
console.log(chalk.neonGreen('Neon Green Text'));
// Gradients
console.log(chalk.gradient('red', 'blue')('Gradient Text'));
// ASCII Art
console.log(chalk.ascii('Hello', { font: 'Ghost' }));
// Animations
const animation = chalk.animate.rainbow('Animating...');
setTimeout(() => animation.stop(), 3000);
// Spinners
const spinner = chalk.spinner('Loading...').start();
setTimeout(() => spinner.succeed('Done!'), 2000);
`
You can add your own custom styles using the addStyle method:
`javascript``
chalk.addStyle('customStyle', (text) => chalk.rgb(50, 100, 50)(text));
console.log(chalk.customStyle('Custom Style'));
This project is licensed under the MIT License.