Socket
Socket
Sign inDemoInstall

nfe2stalk

Package Overview
Dependencies
170
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.8 to 0.0.9

lib/data/informacoes.db

39

lib/start.js
const schedule = require('node-schedule')
const util = require('./utils')
const EventEmitter = require('events')
var alerta = false
function start (options) {
return new Promise((resolve, reject) => {
let j = schedule.scheduleJob(`*/${options.every} * * * * *`, function () {
util.crawler(function (err, info) {
if (err) reject(err)
class MyEmitter extends EventEmitter {}
if (info.numero) { info.url = `http://www.nfe.fazenda.gov.br/portal/informe.aspx?ehCTG=false#${info.numero}` }
const monitorar = new MyEmitter()
if (options.fullNotify && !info) { return resolve(false) }
function iniciar (options) {
// return new Promise((resolve, reject) => {
resolve(info)
})
let j = schedule.scheduleJob(`*/${options.every} * * * * *`, function () {
util.crawler(function (err, info) {
if (err) {
return monitorar.emit('alerta', err)
}
// console.log(info)
if (info.numero) {
info.url = `http://www.nfe.fazenda.gov.br/portal/informe.aspx?ehCTG=false#${info.numero}`
alerta = info
return monitorar.emit('alerta', alerta)
}
if (options.fullNotify && !info) {
alerta = false
return monitorar.emit('alerta', alerta)
}
alerta = info
monitorar.emit('alerta', alerta)
})
})
// })
}
module.exports = {
start
iniciar,
alerta,
monitorar
}

@@ -13,3 +13,3 @@ {

],
"version": "0.0.8",
"version": "0.0.9",
"author": {

@@ -16,0 +16,0 @@ "name": "Igor Souza Martins",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc