Skip to content

A basic utility to draw boxes with drop shadows in command line output.

License

Notifications You must be signed in to change notification settings

ngsctt/shadow-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shadow-box

A basic utility to draw boxes with drop shadows in command line output. Heavily inspired by boxen.

Why

I couldn't find any other packages that produce drop shadows using basic box drawing elements, so I made my own.

How

  1. Install the package:

    npm i @ngsctt/shadow-box
    

    Or, using pnpm:

    pnpm i @ngsctt/shadow-box
    
  2. Require the package:

    const shadowBox = require('@ngsctt/shadow-box');
  3. Use the package:

    const text = 'Some text, including ' + chalk.yellowBright('highlights') + ',\n can be used.';
    const shadowBoxOptions = {  // default options:
      background: '#0000ff',
      shadow: '#ff0000',
      padX: 2,
      padY: 1,
      marX: 3,
      marY: 1,
      newLine: '\n',
      padChar: ' ',
      align: 'center'
    };
    
    console.info(shadowBox(text, shadowBoxOptions));

    Example terminal output

Licence

Released under the MIT Licence.

About

A basic utility to draw boxes with drop shadows in command line output.

Resources

License

Stars

Watchers

Forks

Packages

No packages published