https://github.com/valtech-commerce/terminal-pad
Terminal-friendly string pad
https://github.com/valtech-commerce/terminal-pad
npm-package terminal
Last synced: 2 months ago
JSON representation
Terminal-friendly string pad
- Host: GitHub
- URL: https://github.com/valtech-commerce/terminal-pad
- Owner: valtech-commerce
- License: mit
- Created: 2023-02-07T16:47:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-07T16:56:17.000Z (over 3 years ago)
- Last Synced: 2025-02-28T21:47:49.699Z (over 1 year ago)
- Topics: npm-package, terminal
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @valtech-commerce/terminal-pad
[](https://www.npmjs.com/package/@valtech-commerce/terminal-pad)
[](https://david-dm.org/valtech-commerce/terminal-pad)
[](https://npms.io/search?q=%40valtech-commerce%2Fterminal-pad)
[](https://travis-ci.org/valtech-commerce/terminal-pad/builds)
[](https://github.com/valtech-commerce/eslint-config-node)
> Terminal-friendly string pad
## Install
```sh
$ npm install @valtech-commerce/terminal-pad
```
## Usage
```js
const chalk = require('chalk');
const pad = require('@valtech-commerce/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 © [Valtech Canada inc.](https://www.valtech.ca/)