@full-pack/string-pack
![npm](https://img.shields.io/npm/v/@full-pack/string-pack.svg)
![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
A lightweight and versatile String Utility Package for Node.js & Browser.
Contents
install
npm install @full-pack/string-pack
require
const { ... } = require('@full-pack/string-pack');
import
import { ... } from '@full-pack/string-pack';
API
padding
Adds padding to given string.
padStart
Pads the start of a string with a specified fill string a certain number of times.
padStart('hello', 'abc', 3)
padStart('hello', 'abc', 3, 8)
padEnd
Pads the end of a string with a specified fill string a certain number of times.
padEnd('hello', 'abc', 3);
padEnd('hello', 'abc', 3, 8);
padBidirectional
Pads a string with a specified fill string a certain number of times on both ends.
padBidirectional('hello', '*', 2);
padBidirectional('world', '-', 3, 10);
padBidirectional('example', '*', 2, 10, 0);
Build
npm run build
License
The MIT License. Full License is here