Skip to content
/ fnr Public

NPM package that validation phone numbers & emails & dates and many more ...

License

Notifications You must be signed in to change notification settings

FnrDev/fnr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fnr

fnr
  • NPM package that validation phone numbers & emails & dates and many more ...

Installation from NPM

npm install fnr

Examples Regex

const fnr = require('fnr');
const validation = new fnr.validation();

const isEmail = validation.isEmail('me@fnrr.dev');
const isPhoneNumber = validation.isPhoneNumber('+31636363634');
const isDate = validation.isDate('12/5/2021');
const isURL = validation.isURL('https://youtube.com');
const isImage = validation.isImage('https://probot.io/static/logo1.jpg');
const isHexColor = validation.isHexColor('#ff0000');
const isIP = validation.isIP('63.73.251.116');

console.log(isEmail); // true
console.log(isPhoneNumber); // true
console.log(isDate); // true
console.log(isURL); // true
console.log(isImage); // true
console.log(isHexColor); // true
console.log(isIP); // true

Others

const fnr = require('fnr');
const shortClient = new fnr.shortURL('GET_YOUR_KEY_FROM_https://app.bitly.com/settings/api/');

async function shortURL(url) {
    const e = await shortClient.short(url);
    console.log(e);
}

shortURL('https://probot.io');

Output

{
  created_at: '2021-11-14T14:35:44+0000',
  id: 'bit.ly/31Q14jw',
  link: 'https://bit.ly/31Q14jw',
  custom_bitlinks: [],
  long_url: 'https://probot.io/',
  archived: false,
  tags: [],
  deeplinks: [],
  references: { group: 'https://api-ssl.bitly.com/v4/groups/Bk98d0JwFyp' }
}