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

@jitsistemas/nfce-emitter

v1.0.0

Published

Emissor NFC-e brasileiro (NF-e 4.0 modelo 65) — geracao de XML, assinatura digital A1, envio SEFAZ, contingencia offline (tpEmis=9) e DANFE PDF

Readme

@jitsistemas/nfce-emitter

Emissor NFC-e brasileiro (NF-e 4.0 modelo 65) em TypeScript — geração de XML, assinatura digital A1, envio SEFAZ, contingência offline (tpEmis=9) e DANFE PDF.

Uso em produção pelo JIT ERP desde 2026-07 (multiestados: SP, MG, RJ, PR, RS + demais UFs). Testado em milhares de emissões.

Recursos

  • XML NFC-e 4.0 (modelo 65) — todos os grupos SEFAZ obrigatórios
  • Assinatura digital A1 (xml-crypto — canonical XML + SHA-256)
  • Envio SEFAZ (endpoints todos os 27 UFs — homologação + produção)
  • Contingência offline (tpEmis=9) — cliente sem conexão SEFAZ emite localmente, transmite ao reconectar
  • DANFE PDF (via pdfkit) — comprovante impressão térmica 80mm
  • QR Code oficial SEFAZ (v2)
  • Reforma Tributária (CBS/IBS/IS — NT 2025.002 v1.50)
  • Simples Nacional (CRT 1/2/4) — grupos CSOSN + PIS/COFINS
  • CRT 3 (Lucro Presumido/Real) — CST + IBS/CBS por item

Instalação

npm install @jitsistemas/nfce-emitter
# ou
pnpm add @jitsistemas/nfce-emitter

Uso básico

import {
  gerarXMLNFCe,
  assinarXML,
  carregarCertificado,
  AutorizacaoService,
  emitirContingencia,
  TipoEmissao,
} from '@jitsistemas/nfce-emitter';

// 1. Carregar certificado A1 (arquivo .pfx + senha)
const cert = carregarCertificado(pfxBuffer, senha);

// 2. Montar dados da nota
const dados: DadosNFCe = {
  cUF: 35,               // SP
  dhEmi: new Date(),
  serie: 1,
  nNF: 12345,
  tpAmb: AmbienteNFe.PRODUCAO,
  emit: { CNPJ: '00000000000000', xNome: 'MINHA LOJA LTDA', /* ... */ },
  itens: [ /* ... */ ],
  pag: { detPag: [ /* ... */ ] },
  total: { /* ... */ },
};

// 3. Gerar XML + assinar
const { xml, chaveAcesso } = gerarXMLNFCe(dados);
const xmlAssinado = assinarXML(xml, cert);

// 4. Enviar ao SEFAZ
const autorizacao = new AutorizacaoService();
const resultado = await autorizacao.enviar({
  uf: 'SP',
  ambiente: dados.tpAmb,
  xmlAssinado,
  certificado: cert,
});

Contingência offline (tpEmis=9)

Quando SEFAZ está inacessível (rede caiu, servidor SEFAZ fora):

import { emitirContingencia } from '@jitsistemas/nfce-emitter';

const { xmlAssinado, chaveAcesso, danfePdf, qrCodeUrl } = await emitirContingencia(
  dados,
  { certificadoPfx, certificadoSenha, csc, cscId },
  'Sem conexão com SEFAZ no momento da venda',
);

// Imprime DANFE com aviso "EMITIDA EM CONTINGÊNCIA"
// Salva XML localmente pra retransmitir quando SEFAZ voltar
// Retransmissão via ContingenciaService (planejado)

Base legal

  • NT 2025.002 v1.50 — Reforma Tributária (CBS/IBS/IS)
  • Ajuste SINIEF 19/2016 — Cláusula décima segunda (contingência offline)
  • Manual de Integração NFC-e v6.00

Status do projeto

  • Versão: 1.0.0
  • Mantenedor: JIT Sistemas
  • Uso em produção: sim (JIT ERP desde 2026-07)
  • Suporte comunidade: best-effort via issues do GitHub

Contribuindo

PRs bem-vindos, mas note:

  • Este package é o motor fiscal de um ERP em produção — mudanças precisam manter backward compat
  • Testes obrigatórios (Jest, cobertura ≥80% em código fiscal)
  • Discussões em issues antes de PRs grandes

License

Apache License 2.0

Copyright 2026 JIT Sistemas