npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pix-qr-code-detail

v1.2.0

Published

Inspeciona BR Codes Pix dinamicos, extrai URL de payload e decodifica JWT.

Readme

pix-qr-code-detail

Node.js

Pacote Node.js minimalista para inspecionar BR Codes Pix de cobrancas dinamicas:

  1. Faz o parsing TLV do QR Code/BR Code;
  2. Localiza a Merchant Account Information Pix, tags 26 a 51;
  3. Extrai a URL do payload dinamico na subtag 25;
  4. Baixa o payload via HTTP/HTTPS;
  5. Decodifica o JWT e devolve { header, payload, signature }.

O pacote publica ESM e CommonJS, nao executa exemplos ao ser importado e nao possui dependencias de runtime.

Instalacao

npm i pix-qr-code-detail

Uso

import { parseTLV, extractPixUrl, getDecodedPixJwt } from 'pix-qr-code-detail';

const brcode = '00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/ff719c748dc244a294adee9174ace3795204000053039865802BR5905EFISA6008SAOPAULO62070503***6304BAC4';

console.dir(parseTLV(brcode), { depth: null });
console.log('URL:', extractPixUrl(brcode));

const { payload } = await getDecodedPixJwt(brcode);
console.log('Payload JWT:', payload);

CommonJS tambem e suportado:

const { getDecodedPixJwt } = require('pix-qr-code-detail');

API

parseTLV(brcode)
Converte a string do BR Code em um array de objetos TLV. Cada item traz tag, length, value, tagName e, quando aplicavel, children.

extractPixUrl(brcode)
Retorna a URL do payload dinamico na subtag 25 dentro da Merchant Account Information. Em QR Codes estaticos, onde normalmente existe chave Pix na subtag 01 em vez de URL de payload, retorna undefined.

getDecodedPixJwt(brcode, options?)
Usa extractPixUrl, acrescenta DPP=YYYY-MM-DD na URL do payload com a data local do dia, baixa o payload com fetch e decodifica o JWT. Aceita:

{
  timeoutMs?: number;
  fetch?: typeof fetch;
  headers?: Record<string, string>;
}

decodeJwt(token)
Decodifica um JWT ja obtido e devolve { header, payload, signature }.

O pacote decodifica o JWT para leitura/detalhamento. Ele nao verifica criptograficamente a assinatura.

Desenvolvimento

npm run build
npm pack --dry-run

O build gera:

  • dist/esm/index.js
  • dist/esm/index.d.ts
  • dist/cjs/index.js

Licenca

MIT