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

@4success/nfse-campinas

v2.2.0

Published

NFSe Campinas

Readme

NFSe Campinas

Pacote de integração para os webservices da prefeitura de Campinas no padrão ABRASF 2.03.

Importante: Se você procura a integração no padrão DSFNET, utilize a versão 1.x deste pacote.

Versões Disponíveis

  • 2.x (Atual): Padrão ABRASF 2.03

    yarn add @4success/nfse-campinas
    # ou
    npm install @4success/nfse-campinas
  • 1.x (Legacy): Padrão DSFNET

    yarn add @4success/nfse-campinas@^1.0.0
    # ou
    npm install @4success/nfse-campinas@^1.0.0

Compatibilidade

Este pacote é compatível com municípios que utilizam o Padrão ABRASF 1.3 ou superior. É necessária a utilização de Certificado Digital A1.

API como Serviço (SaaS)

Desenvolvemos uma API hospedada para facilitar a integração com NFSe Campinas para desenvolvedores que não trabalham com NodeJS ou precisam de uma solução mais rápida de implementar.

🌐 NFSe Hub: https://nfsehub.4success.com.br

Principais benefícios:

  • Integração independente de linguagem de programação
  • Sem necessidade de gerenciar certificados digitais
  • Documentação completa e exemplos de uso
  • Suporte para todos os endpoints do pacote NFSe Campinas
  • Ambiente de homologação e produção

Visite nosso site para mais detalhes, documentação da API e planos de contratação.

Como Usar

Configuração Básica

import { NfseCampinas } from '@4success/nfse-campinas';

const cert = fs.readFileSync('/caminho/para/certificado.pfx');
const nfse = new NfseCampinas(
        'https://homol-rps.ima.sp.gov.br/notafiscal-abrasfv203-ws/NotaFiscalSoap?wsdl',
        cert,
        'senhaCertificado'
);

Exemplo de Consulta

const response = await nfse.ConsultarNfseServicoPrestado({
  ConsultarNfseServicoPrestadoEnvio: {
    Prestador: {
      CpfCnpj: {
        Cnpj: '99999999000199',
      },
    },
    PeriodoCompetencia: {
      DataFinal: '2024-08-31',
      DataInicial: '2024-08-01',
    },
  }
});

Impressão da DANFE

const pdfBuffer = await nfse.ImprimirNfse({
  cnpj: '99999999000199',
  inscricaoMunicipal: '1234567',
  numeroNfse: '123',
  codigoVerificacao: 'ABC123'
});

// Salvar o PDF
fs.writeFileSync('danfe.pdf', pdfBuffer);

Configuração para Serverless (AWS Lambda)

Para utilizar em ambientes serverless, adicione as seguintes configurações:

  1. No seu serverless.yml, adicione a layer necessária:
layers:
  - arn:aws:lambda:us-east-1:034541671702:layer:openssl-lambda:1

Funcionalidades

✅ Implementado

  • ✅ Emissão com XMLs assinados
  • ✅ Consulta de NFSe por RPS
  • ✅ Consulta de serviços prestados
  • ✅ Consulta de serviços tomados
  • ✅ Cancelamento de NFSe
  • ✅ Impressão da DANFE em PDF
  • ✅ Suporte para ambientes serverless

Links Úteis

Contribuindo

  1. Faça um fork do projeto
  2. Crie sua feature branch (git checkout -b feature/MinhaFeature)
  3. Commit suas mudanças (git commit -am 'Adicionando nova feature')
  4. Push para a branch (git push origin feature/MinhaFeature)
  5. Crie um novo Pull Request

Suporte

Para suporte, dúvidas ou sugestões, por favor abra um issue no repositório.