
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This lib identifies/validates, normalizes and formats a Pix key from a string, directly inferencing the key type.
Note that it only validates the data type and does not check whether a Pix key is registered on Bacen's DICT. For that, you must be a registered Pix participant or work with one.
npm i pixkey
import { validate, format, normalize } from 'pixkey'
// or
const { validate, format, normalize } = require('pixkey')
This lib exposes three functions. They all receive one first argument: the pix key as a string.
normalize and format may also return a second argument "as" (string), to indicate which Pix key type ('cpf', 'cnpj', 'email', 'phone' or 'random') and should be used if the input is dual (i.e. both a valid phone number and CPF).
[] (empty array) if the key is invalid.Tests are available using Mocha. Run npm test.
MIT
2.0.1
2.0.0
validate() now returns an array instead of a string. The array may contain multiple elements (i.e. if the input is a valid CPF but also a valid phone number) or only one.validate() now returns an empty array, and no longer false, if the input is not valid.1.0.0
FAQs
Identify, validate, format and normalize a Pix key type from a string
The npm package pixkey receives a total of 2,190 weekly downloads. As such, pixkey popularity was classified as popular.
We found that pixkey demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.