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 🙏

© 2024 – Pkg Stats / Ryan Hefner

boleto-br

v0.2.0

Published

A tool to generate brazilian banks boleto

Downloads

71

Readme

boleto-br

Um conjunto de funções úteis para geração de boleto de cobrança de banco brasileiros.

Motivação

facilitar a geração de boletos de cobrança de bancos brasileiros, ele não gera um html ou mesmo um pdf do boleto, para isso recomendo o uso do boleto-pdf.

Suporte:

| Barco | Suporte | |--------------|----------------------| | Bradesco | :white_check_mark: | | Caixa | Em breve | | Santander | Help Wanted | | Itaú | Help Wanted | | Outros | Help Wanted |

Instalação

Este projeto usa node e npm. Verifique em seu sistema se já estão instalados, corretamente.

$ npm install boleto-br --save

Uso

Geração de boleto

const {bill,bradesco} = require('boleto-br')
const bradescoBill = bill(bradesco)
const {generateBillData} = bradescoBill

const boletos =  [
  {
    ...
    expirationDay: Date,
    value: number,
    agency: string,
    card: string,
    ourNumber: string,
    account: number
  }
]
generateBillData(boletos).then( data => {
  // do something with data
}).catch(err => {
  console.log(err)
})

Veja aqui uma descrição mais detalhada de como gerar um pdf.

Geração de arquivo de remessa


const {bill,bradesco} = require('boleto-br')
const bradescoBill = bill(bradesco)
const {generateRemittanceFile} = bradescoBill

const boletos = {
  emitterCompanyCode: '433923',
  agencyNumber: '7506',
  agencyDigit: 1,
  accountNumber: 54291,
  accountDigity: 1,
  emitterCompany: 'ACME. SA',
  card: '09',
  date: new Date(2017, 6, 10),
  seedingSequentialNumber: 1,
  bills: [
    {
      ourNumber: '1',
      documentNumber: '1',
      value: 10000,
      lateFee: true,
      lateFeePercentual: 2,
      lateFeeValuePerDay: 17,
      occurencyCode: '01',
      expirationDay: new Date(2017, 6, 10),
      debtType: '12',
      issueDay: new Date(2017, 6, 10),
      discountDayLimit: 0,
      discountValue: 0,
      iofValue: 0,
      decreaseValue: 0,
      discountPerDay: 0,
      registerType: '01',
      instructionOne: '00',
      instructionTwo: '00',
      registerNumber: '83901298000138',
      payerName: 'JOHN BUYER',
      payerAddress: 'CLOWN SC',
      messageOne: '',
      payerPostalCode: '88703500',
      messageTwo: '083901298000138 ACME SA'
    }
  ]
}

generateRemittanceFile(boletos).then(data =>{
  fs.writeFile("./REMESSATEST.REM", data , function(err) {
    if(err) {
      return console.log(err)
    }
    console.log("The file was saved!")
  })
}).catch(err =>{
  console.log(err)
})

Veja aqui a descrição detalhada dos campos, para geração de remessa Bradesco.

Isto produzira um arquivo de remessa como esse:

01REMESSA01COBRANCA       00000000000000433923ACME. SA                      237BRADESCO       100717        MX0000001                                                                                                                                                                                                                                                                                     000001
1                   00090750600542911                         2372000200000000001100000000002N              01000000000110071700000000100000000000012N100717000000000000000170000000000000000000000000000000000000000000000183901298000138JOHN BUYER                              CLOWN SC                                            88703500083901298000138 ACME SA                                     000002
9                                                                                                                                                                                                                                                                                                                                                                                                         000003

Contribuindo

Veja o contributing file.

Licença

MIT License © Rafael Castro