2022.11.8 ā¢ Published 2 years ago
fluwence-util v2022.11.8
Fluwence Util
š Fluwence Utility Package for making complex tasks simpler.
Installation
npm install fluwence-util
What's New in v2022.11.8?
+ Validate Email addresses
+ Validate URLs or Links
+ Validate Color Hex Codes
Usage
- Validate an URL
const { isURL } = require('fluwence-util');
const url_1 = 'https://fluwence.cf';
const url_2 = 'not_an_url-lol';
const $1 = isURL(url_1);
const $2 = isURL(url_2);
console.log($1); // true
console.log($2); // false
- Validate an Email address
const { isEmail } = require('fluwence-util');
const email_1 = 'example@example.flw';
const email_2 = 'not_@n_email-lol';
const $1 = isURL(email_1);
const $2 = isURL(email_2);
console.log($1); // true
console.log($2); // false
- Validate a color hex code
const { isValidHexCode } = require('fluwence-util');
const code_1 = '#4655FF';
const code_2 = '#NOT_A_HEX_CODE';
const $1 = isURL(code_1);
const $2 = isURL(code_2);
console.log($1); // true
console.log($2); // false
- Capitalize First Character/Letter of first word of a Sentence
const { capitalizeFirstChar } = require('fluwence-util');
const sentence = 'my name is fluwence!';
const newSentence = capitalizeFirstChar(sentence); // Capitalizes only the first letter of first word
console.log(newSentence); // "My name is fluwence!"
- Capitalize each new word of a Sentence
const { capitalizeFirstCharForEach } = require('fluwence-util');
const sentence = 'my name is fluwence!';
const newSentence = capitalizeFirstCharForEach(sentence); // Capitalizes first letter of every new word
console.log(newSentence); // "My Name Is Fluwence!"
- Validate Usernames, can only contain:
A-Z
,a-z
,0-9
,_
,-
,.
const { isValidUsername } = require('fluwence-util');
const username_1 = 'fluwence_user';
const username_2 = 'fluwence$user';
console.log(isValidUsername(username_1)); // true
console.log(isValidUsername(username_2)); // false
Information
- Latest Version:
v2022.11.8
- Recommended Version:
v2022.11.8
- Total Utility Functions:
6
- Last Updated:
08.11.2022
- Last Updated by: snehasishcodes
- GitHub: Click Here
- RunKit: Try Now