@absolunet/terminal-pad

Terminal-friendly string pad

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Feb 12, 2019Mar 27, 2017Minified + gzip package size for @absolunet/terminal-pad in KB

Readme

@absolunet/terminal-pad

npm npm dependencies npms Travis CI Code style ESLint

Terminal-friendly string pad

Install

$ npm install @absolunet/terminal-pad

Usage

const chalk = require('chalk');
const pad   = require('@absolunet/terminal-pad');

pad(chalk.bgRed('📛 Error'), 20);
//=> '📛 Error             '

API

pad(text, length)

Returns a String with padded text

text

Required
Type: String

The text to pad.

length

Required
Type: Number

The total length of outputted string.

License

MIT © Absolunet

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.