Installations
npm install shell-artist
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.10.0
NPM Version
10.2.3
Score
62.5
Supply Chain
96
Quality
74.4
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Download Statistics
Total Downloads
2,741
Last Day
3
Last Week
13
Last Month
73
Last Year
1,128
Bundle Size
415.99 kB
Minified
96.65 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.7.2
Package Id
shell-artist@2.7.2
Unpacked Size
15.72 kB
Size
4.99 kB
File Count
4
NPM Version
10.2.3
Node Version
20.10.0
Publised On
25 Mar 2024
Total Downloads
Cumulative downloads
Total Downloads
2,741
Last day
-25%
3
Compared to previous day
Last week
0%
13
Compared to previous week
Last month
58.7%
73
Compared to previous month
Last year
-30.1%
1,128
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
ShellArtist
ShellArtist is a package that provides a simplified logging API. It takes some of the best npm packages, ties them together and wraps them around to your favorite Web API i.e. console.
Table of Contents
Features
- Apply Colors and Background colors to your texts
- Create colorful and customizable Boxes in your terminal
- Use amazing prebuilt Animations
- Apply Gradient colors to your texts
- Use prebuilt Status messages for your console
- Add attractive spinners for async operations
- Get your favorite emoticons to make it fun
- Convert your texts into ascii arts
Use Cases
- You can create your custom logging service
- You can create spectacular CLIs
Packages Used
Usage
Installation
1# using npm 2npm i shell-artist 3 4# using yarn 5yarn add shell-artist 6 7# using pnpm 8pnpm add shell-artist
Default Log
1import sa from 'shell-artist'; 2 3sa.log('Hello World');
Output
1Hello World
With config
object
1import sa from 'shell-artist'; 2 3sa.log(' MY CLI APP ', { 4 bgColor: 'bgGreenBright', // https://github.com/chalk/chalk/tree/main#background-colors, 5 color: 'white', // https://github.com/chalk/chalk/tree/main#colors 6 modifier: 'bold', // https://github.com/chalk/chalk/tree/main#modifiers 7 emoji: 'rocket', // https://github.com/muan/emojilib/blob/main/dist/emoji-en-US.json, 8 box: { 9 title: 'package update', 10 borderColor: 'green', 11 style: 'double', // https://github.com/sindresorhus/boxen/tree/main#borderstyle (default - 'single') 12 padding: 2, // default - 1 13 margin: 2, // default - 1 14 dimBorder: true, // default - false 15 textAlignment: 'center', // default - 'center' 16 titleAlignment: 'left', // default - 'center' 17 }, 18});
Output
Log Levels
1import sa from 'shell-artist'; 2 3sa.warn('CAUTION'); 4sa.error('FAILURE'); 5sa.info('INFO'); 6// with the config object 7sa.success(' SUCCESS ', { 8 box: { 9 title: 'success', 10 borderColor: 'green', 11 }, 12 modifier: 'bold', 13 emoji: 'rocket', 14});
Output
Spinner
1import sa from 'shell-artist'; 2import { setTimeout as sleep } from 'node:timers/promises'; 3 4const spinner = sa.start('Installing dependencies...'); 5await sleep(3000); 6 7sa.stop(spinner, 'All set!'); 8// with the config object 9sa.stop(spinner, 'All set!', { 10 modifier: 'strikethrough', 11}); 12// with prebuilt log levels 13sa.stop( 14 spinner, 15 'Build ran successfully', 16 { 17 modifier: 'bold', 18 }, 19 'success', 20); // status = 'success' | 'error' | 'info' | 'warn' 21sa.stop(spinner, 'Something went wrong', undefined, 'error');
Output
1 All set! 2 All set! 3✔ Build ran successfully 4✖ Something went wrong 5 6(will be updated with gifs)
Gradient
1import sa from 'shell-artist'; 2 3// with array of colors 4sa.applyGradient('This tool will help you write beautiful logs', [ 5 'red', 6 'blue', 7 'green', 8 'yellow', 9]); 10// with prebuilt gradient 11sa.applyGradient('This tool will help you write beautiful logs', 'rainbow'); // https://github.com/bokub/gradient-string#available-built-in-gradients
Output
Animations
1import sa from 'shell-artist'; 2 3sa.animate('ANIMATED HEADING', 'neon'); // https://github.com/bokub/chalk-animation#available-animations
Output
ASCII Arts
1import sa from 'shell-artist'; 2 3sa.createAscii('Sample ASCII TeXt', { 4 font: 'Ghost', // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/figlet/index.d.ts (default - 'Standard') 5 horizontalLayout: 'full', // "default" | "full" | "fitted" | "controlled smushing" | "universal smushing" | undefined; 6 verticalLayout: 'fitted', // "default" | "full" | "fitted" | "controlled smushing" | "universal smushing" | undefined; 7 width: 80, 8 whitespaceBreak: true, 9});
Output
No vulnerabilities found.
No security vulnerabilities found.