padifier

Padifier can be used to add padding on left or right side of a string.

Usage no npm install needed!

<script type="module">
  import padifier from 'https://cdn.skypack.dev/padifier';
</script>

README

Padifier can be used to add padding on left or right side of a string.

Padding can be empty spaces or any character.

How to use

npm install paddifier

Left padding

var padifier = require('padifier');

padifier.padLeft('howdy', 5, ' '); // pad with empty space
padifier.padLeft('howdy', 5, '

); // pad with $ sign

Right padding

var padifier = require('padifier');

padifier.padRight('howdy', 5, ' '); // pad with empty space
padifier.padRight('howdy', 5, '

); // pad with $ sign

Pad both left and right

var padifier = require('padifier');

padifier.padBoth('howdy', 5, ' '); // pad with empty space
padifier.padBoth('howdy', 5, '

); // pad with $ sign

Run Tests

npm install && npm test

License

MIT © Deepak Kapoor