/zeefy

✨ zeefy is a lib designed to manipulate strings in different ways, validation, searches, transformations and more.

Primary LanguageTypeScript

Zeefy - library for string manipulation

TypeScript JavaScript NodeJS NPM Git GitHub


✨ zeefy is a lib designed to manipulate strings in different ways, validation, searches, transformations and more.

🪄 Features

  • ✅ - Email validation

    • z.email Receives a string parameter, which will be the validation level of the email
      • email-basic: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/
      • email-medium: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}.[a-zA-Z]{2,}$/,
      • email-advanced: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}(?:.[a-zA-Z]{2,})?$/
    • z.email().test() Receives as a parameter the string that contains the email to be tested
  • ✅ - Password validation

    • z.password Receives a string parameter, which will be the validation level of the password
      • password-basic: /^(?=.\d)(?=.[a-zA-Z]).{6,}$/
      • password-medium: /^(?=.\d)(?=.[a-zA-Z])(?=.[!@#$%^&]).{8,}$/,
      • password-advanced: /^(?=.\d)(?=.[a-z])(?=.[A-Z])(?=.[!@#$%^&*]).{10,}$/
    • z.password().test() Receives as a parameter the string that contains the email to be tested
  • ✅ - String formatation

    • z.format() Receives a string type parameter that will be the format you want to transform the string into
      • brazil-phone: '+55 (##) 9-####-####',
      • brazil-cep: '#####-###',
      • brazil-cpf: '###.###.###-##',
      • brazil-cnpj: '##.###.###/####-##'
    • z.format().to() Receivezs as a parameter the string that contains the content to be formated

⚠️ - Installation - unready

for npm users:

  npm install zeefy

for yarn users:

  yarn add zeefy

for pnpm users:

  pnpm install zeefy

🚀 - Usage/Examples

Init the zeefy class

import Zeefy from 'zeefy'

const z = new Zeefy()

Validate an email or password

console.log(
    z.email('email-basic').test('luisdavi.contato@gmail.com'), // Return true its a valid email
    z.password('password-basic').test('12312a3') // Return false its a not valid password
)

Format an string with template

console.log(
    z.format('1234567890').to('brazil-phone') // Return +55 (12) 9-3456-7890
    z.format('12345678901').to('brazil-cpf') // Return 123.456.789-01
    ...
)

Authors

Foto de perfil Descrição
Sua Foto de Perfil Olá, eu sou Luis Davi, um desenvolvedor entusiasta que criou a biblioteca webMaster. Estou sempre buscando maneiras de tornar a web mais incrível e funcional.

  • 💼 Conecte-se comigo no LinkedIn
  • 🌐 Visite o meu site pessoal para saber mais sobre meus projetos
  • 📸 Siga-me no Instagram para ver as últimas novidades

Fique à vontade para entrar em contato comigo para qualquer dúvida ou colaboração!