@andresciceri/fill-string

1.0.1 • Public • Published

Fill String 1.0.0

Library to create a new Strign with a specific size. If the previous string is less than new specific size, the function return a string filled with a comodin character.

Example:

import FillString from '@andresciceri/fill-string';

// Text
const fl = new FillString();
const actualText = `hello`;
console.log('New Text:', fl.fill(actualText, 'o', {maxSize: 10, position: 'END'})); // New Text: Helloooooo

// Binary

const fl = new FillString();
const actualBin = `0110`;
console.log('New Bin:', fl.fill(actualBin, '0', {maxSize: 6, position: 'START'})); // New Bin: 000110

Package Sidebar

Install

npm i @andresciceri/fill-string

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

4.58 kB

Total Files

7

Last publish

Collaborators

  • andresciceri