Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
brformsvalidator
Advanced tools
FormsValidator is a comprehensive JavaScript library designed to validate various types of form inputs. This library provides a robust set of validators for common form fields such as CNPJ, CPF, email, name, date, and username. It ensures that the data en
BrFormsValidator is a comprehensive library designed to validate various types of Brazilian forms data, including CNPJ, CPF, email, name, date, US date, and username. This module ensures that your form inputs are correctly formatted and valid according to Brazilian standards.
To install BrFormsValidator, you can use npm with the following commands:
npm install brformsvalidator
npm install brformsvalidator --save
npm install brformsvalidator --save-dev
To use BrFormsValidator in your project, you need to import it as follows:
const BrFormsValidator = require('brformsvalidator');
const BrFormsValidator = require('brformsvalidator');
const validator = new BrFormsValidator('12345678000195', '12345678909', 'test@example.com', 'John', 'Doe', '01/01/2000',
'
01/01/2000', 'username123');
// Validate CNPJ
const [isCnpjValid, cnpjError] = validator.validateCnpj();
console.log(isCnpjValid, cnpjError);
// Validate CPF
const [isCpfValid, cpfError] = validator.validateCpf();
console.log(isCpfValid, cpfError);
// Validate email
const [isEmailValid, emailError] = validator.validateEmail();
console.log(isEmailValid, emailError);
// Validate name
const [isNameValid, nameError] = validator.validateName();
console.log(isNameValid, nameError);
// Validate date
const [isDateValid, dateError] = validator.validateDate();
console.log(isDateValid, dateError);
// Validate US date
const [isUsDateValid, usDateError] = validator.validateUsDate();
console.log(isUsDateValid, usDateError);
// Validate username
const [isUsernameValid, usernameError] = validator.validateUsername();
console.log(isUsernameValid, usernameError);
const BrFormsValidator = require('brformsvalidator');
const cpfValidator = new BrFormsValidator('', '12345678909');
const [isCpfValid, cpfError] = cpfValidator.validateCpf();
console.log(isCpfValid, cpfError);
const BrFormsValidator = require('brformsvalidator');
const emailValidator = new BrFormsValidator('', '', 'test@example.com');
const [isEmailValid, emailError] = emailValidator.validateEmail();
console.log(isEmailValid, emailError);
validateCnpj()
: Validates the CNPJ.validateCpf()
: Validates the CPF.validateEmail()
: Validates the email.validateName()
: Validates the name and surname.validateDate()
: Validates the date in Brazilian format.validateUsDate()
: Validates the date in US format.validateUsername()
: Validates the username.We welcome contributions from the community. If you would like to contribute, please fork the repository and submit a pull request.
This project is licensed under the MIT License.
Currently, the only contributor is the author, Danilo Santana.
FAQs
FormsValidator is a comprehensive JavaScript library designed to validate various types of form inputs. This library provides a robust set of validators for common form fields such as CNPJ, CPF, email, name, date, and username. It ensures that the data en
The npm package brformsvalidator receives a total of 0 weekly downloads. As such, brformsvalidator popularity was classified as not popular.
We found that brformsvalidator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.