Socket
Book a DemoInstallSign in
Socket

suapapi-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suapapi-wrapper

Um wrapper para a SUAP API.

npmnpm
Version
1.0.2
Version published
Weekly downloads
17
240%
Maintainers
1
Weekly downloads
 
Created
Source

SUAP API wrapper

Um wrapper da SUAP API que visa facilitar sua integração a aplicações nodejs.

Instalação

  npm install suapapi-wrapper

Uso

  const suapapi = require('suapapi-wrapper')

  const boletim = async (matricula, senha, ano, periodo = 1) => {
    const resultado = await suapapi.auth(matricula, senha)
    if (!resultado.token) { return resultado }

    const { token } = resultado

    console.log(`Seu token é ${token}.`)

    const boletim = await suapapi.getReport(token, ano, periodo)
    return boletim
  }

  boletim('matricula', 'senha', '2019').then(console.log)
  const suapapi = require('suapapi-wrapper')

  suapapi.auth('matricula', 'senha').then(response => {
    if (!response.token) { return console.log(response) }

    const { token } = response

    console.log(`Seu token é ${token}.`)

    suapapi.getReport(token, 2019).then(console.log)
  }).catch(console.log)

Para mais informações sobre a utilização, consulte a documentação.

Licença

MIT

Keywords

suap

FAQs

Package last updated on 20 Mar 2020

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