padside.js
v0.1.0
Published
A simple JS lib to pad string or number
Downloads
14
Maintainers
Readme
A simple JS lib
Install
npm i padside.js
Usage
import padside from 'padside.js';
// or
const padside = require('padside.js');
Example
import { padsideLeft, padsideRight } from 'padside.js';
console.log(padsideLeft('123', 10, '0')); // 000000000123
console.log(padsideRight('123', 10, '0')); // 12300000000
API
padsideLeft
padsideLeft(str, length, padStr)
padsideRight
padsideRight(str, length, padStr)
splitPad
splitPad(str, length, padStr)
padsideMid
padsideMid(str, length, padStr)
License
MIT © Padside.js