Zeba
A lightweight JavaScript library for validating, manipulating, and formatting strings.
Install:
npm i zeba
Require:
const
zeba = require
('zeba'
);
How to use:
Example:
let
input = ' this is the input.';
input = new
zeba(input).fullTrim().capitilize();
console.log
(input.string
);
Outcome:
This is the input.
API
Methods:
capitilize()
- Example: this is the text -> This is the text.
upper()
- from: this is the text -> This Is The Text.
allupper()
- from: this is the text -> THIS IS THE TEXT.
fullTrim()
- fully trims the string from front, back and in betweens.
let
text = ' this is the text.'
;
text = new
zeba(text).fullTrim
();
console.log
(text.string
);
- outputs:
this is the text.