slash-bar

Create a bar of slashes to segment output

Usage no npm install needed!

<script type="module">
  import slashBar from 'https://cdn.skypack.dev/slash-bar';
</script>

README

Overview

Slashbar allows you to easily print long bars comprised of forward slashes and backslashes. This can be useful for quickly formatting or breaking up your output.

Installation

$ npm install slash-bar

Usage

const slashbar = require('slash-bar');

slashbar();
/*
Output: //////////////////////////////
*/

slashbar(30);
/*
Output: //////////////////////////////
The first parameter controls the length of the bar (Default: 20)
*/

slashbar(30, false);
/*
Output: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
The second parameter controls whether the bar will use forward slashes
(false for backslash) (Default: true)
*/

slashbar(30, true, true);
/*
Output: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
The third parameter controls whether the bar uses an alternating pattern
(true for alternation) (Default: false)
*/

License

MIT