padlr
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

padlr

Left and right padder, i.e. left pad and right pad.

Install

$ npm install padlr

Usage Example

Example: index.ts

import { Padlr } from "padlr";
 
const inputStr = "Hi there";
const str1 = Padlr.left(inputStr, 15);
const str2 = Padlr.left(inputStr, 15,"-");
const str3 = Padlr.right(inputStr, 15, "+");
const str4 = Padlr.right(inputStr, 15);
 
console.log(`str1: ${str1}.`);
console.log(`str2: ${str2}.`);
console.log(`str3: ${str3}.`);
console.log(`str4: ${str4}.`);

Sample Output:

$ ts-node index.ts
str1:        Hi there.
str2: -------Hi there.
str3: Hi there+++++++.
str4: Hi there       .

Package Sidebar

Install

npm i padlr

Weekly Downloads

4

Version

1.0.7

License

MIT

Last publish

Collaborators

  • omt66