Socket
Book a DemoInstallSign in
Socket

consultanfe

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

consultanfe

Retorna os dados de uma NFE (Nota Fiscal Eletrônica), baseado no QRCode

1.5.0
latest
npmnpm
Version published
Weekly downloads
3
-86.96%
Maintainers
1
Weekly downloads
 
Created
Source

npm version Build Status GitHub release License Open Source Love svg1 ForTheBadge built-with-love

consultaNFE

Biblioteca para retorno de uma promise com os dados de uma NFE (Nota Fiscal Eletrônica) baseada no QRCode.

Unidade Federativas Suportadas

  • AM - Amazonas
  • CE - Ceará
  • MG - Minas Gerais
  • RN - Rio Grande do Norte
  • RS - Rio Grande do Sul

Instalação

Necessário Node.js v8 ou superior.

Instale o ConsultaNFE

$ npm install --save consultanfe

Importe a biblioteca

const consultaNFE = require("consultaNFE");
const QRCodeURL =
	"https://www.sefaz.rs.gov.br/NFCE/NFCE-COM.aspx?chNFe=43181012384687000438651040002069031002069033&nVersao=100&tpAmb=1&cDest=03013156040&dhEmi=323031382D31302D31335431303A34383A32352D30333A3030&vNF=41.33&vICMS=0.00&digVal=4B6C68775A4A4A744D6D396D636264625238794937712B384939303D&cIdToken=000004&cHashQRCode=45EF73C4A9FD11FE6636C6D41678B12F863D6AA7";

var QueryNFE = new consultaNFE(QRCodeURL).get();

QueryNFE.then((NFEDados) => {
	console.log(NFEDados);
});

/*
Deve retornar:
{
  "cabecalho": {
    "dataEmissao": "2018-10-13T13:48:25.000Z",
    "dataEntradaSaida": null,
    "modelo": "65",
    "numero": "206903",
    "serie": "104",
    "total": 41.33
  },
  "emitente": {
    "nome": "FORMENTON FL03",
    "razaoSocial": "SUPERMERCADOS FORMENTON LTDA FL 3",
    "cnpj": "12.384.687/0004-38",
    "rua": "RUA NELSON PAIM TERRA, 934",
    "bairro": "RIO BRANCO",
    "cep": 92200040,
    "cidade": "CANOAS",
    "telefone": "(51)3031-1850",
    "estado": "RS",
    "ibge": 4304606
  },
  "produtos": [
    {
      "descricao": "MASSA LASANHA ROMENA 500G",
      "quantidade": 1,
      "unidade": "UN",
      "preco": 6.98,
      "codigo": 13437,
      "NCM": 19021100,
      "eanComercial": 7896249500066
    },
    {
      "descricao": "CARNE BOV MOIDA PRIMEIRA kg",
      "quantidade": 1.142,
      "unidade": "KG",
      "preco": 27.39,
      "codigo": 12794,
      "NCM": 2013000,
      "eanComercial": null
    },
    {
      "descricao": "AMAC GIRANDO SOL 2L TRAD TALCO",
      "quantidade": 1,
      "unidade": "UN",
      "preco": 3.99,
      "codigo": 1734,
      "NCM": 38099190,
      "eanComercial": 7896404601010
    },
    {
      "descricao": "MOLHO TOMATE CAJAMAR 340G SC",
      "quantidade": 1,
      "unidade": "UN",
      "preco": 1.19,
      "codigo": 6492,
      "NCM": 21032010,
      "eanComercial": 7891080146893
    },
    {
      "descricao": "MOLHO TOMATE CAJAMAR 340G SC",
      "quantidade": 1,
      "unidade": "UN",
      "preco": 1.19,
      "codigo": 6492,
      "NCM": 21032010,
      "eanComercial": 7891080146893
    },
    {
      "descricao": "MOLHO TOMATE CAJAMAR 340G SC",
      "quantidade": 1,
      "unidade": "UN",
      "preco": 1.19,
      "codigo": 6492,
      "NCM": 21032010,
      "eanComercial": 7891080146893
    }
  ]
}
*/

Pendências

  • Escrever mais testes
  • Adicionar mais Unidades federativas

Licença

MIT

Keywords

NFE

FAQs

Package last updated on 04 Feb 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.