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_parser

v0.0.1-b

Published

Analisador de código de barras e linha digitável de boletos

Downloads

12

Readme

boleto_parser

Instalação


  npm install boleto_parser

  yarn add boleto_barser

Uso

import { parse } from "boleto_parser";

// ou

const { parse } = require("boleto_parser");

Funções

parse()

Extrai as informações a partir da linha digitável ou da numeração do código de barras do boleto

import {parse} from 'boleto_parser';
parse('07790.00116 12064.449908 08159.365561 7 90020000015130');

// ->
{
    // Data de vencimento do boleto
    expires_at: 2022-05-31T00:00:00.000Z,
    // Valor convertido em número
    amount_number: 151.3,
    // Forma que o banco usa para exibir os dados do
    // emissor no boleto bancário
    emitter: '0001/0644499',
    // Logo
    logo: 'https://raw.githubusercontent.com/klawdyo/boleto_parser/main/banks/inter.png',
    //
    slug: 'inter',

    // Dados comuns a todos os boletos

    // Código do Banco
    bank: '077',
    // Moeda
    currency: '9',
    // Dígito verificador principal
    mainChecksum: '7',
    // Fator de vencimento: Número de dias passados desde 07/10/1997
    expirationFactor: '9002',
    // Valor em string com 10 caracteres
    amount: '0000015130',

    // Parte específica do banco.
    // Estes caracteres podem conter basicamente qualquer informação
    // que o banco ache relevante. Alguns bancos informam nosso número,
    // número de agência, número de conta, outros usam código de cliente etc.
    // Cada banco trabalha com um padrão diferente.
    variablePart: '0001112064449900815936556',

    // Agência
    agency: '0001',
    // Carteira
    type: '112',
    // Código do cliente
    clientCode: '0644499',
    // Nosso número: ID do boleto dentro do sistema do banco, específico para o cliente
    ourNumber: '0081593655',
    // Dígito verificador do nosso número
    dvOurNumber: '6'
  }

isLine()

Verifica se o valor passado é uma linha digitável