{"id":28560159,"url":"https://github.com/patrickpissurno/degust-cupom-txt","last_synced_at":"2026-04-28T17:05:12.166Z","repository":{"id":57211827,"uuid":"337381996","full_name":"patrickpissurno/degust-cupom-txt","owner":"patrickpissurno","description":"Biblioteca capaz de extrair os dados dos cupons .txt que o sistema de PDV Linx Degust emite.","archived":false,"fork":false,"pushed_at":"2023-06-05T14:46:12.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T11:41:37.788Z","etag":null,"topics":["cupom","degust","js","linx","node","nodejs","parser","txt","venda"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickpissurno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-09T11:25:40.000Z","updated_at":"2022-04-11T12:34:02.000Z","dependencies_parsed_at":"2022-08-30T15:31:25.967Z","dependency_job_id":null,"html_url":"https://github.com/patrickpissurno/degust-cupom-txt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrickpissurno/degust-cupom-txt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fdegust-cupom-txt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fdegust-cupom-txt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fdegust-cupom-txt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fdegust-cupom-txt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickpissurno","download_url":"https://codeload.github.com/patrickpissurno/degust-cupom-txt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fdegust-cupom-txt/sbom","scorecard":{"id":722436,"data":{"date":"2025-08-11","repo":{"name":"github.com/patrickpissurno/degust-cupom-txt","commit":"181d0c980243ea529ea47c5f40423774677b100c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T11:46:30.550Z","repository_id":57211827,"created_at":"2025-08-22T11:46:30.550Z","updated_at":"2025-08-22T11:46:30.550Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cupom","degust","js","linx","node","nodejs","parser","txt","venda"],"created_at":"2025-06-10T09:07:40.230Z","updated_at":"2026-04-28T17:05:12.149Z","avatar_url":"https://github.com/patrickpissurno.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# degust-cupom-txt\n[![npm-version](https://img.shields.io/npm/v/degust-cupom-txt.svg)](https://www.npmjs.com/package/degust-cupom-txt)\n[![build status](https://travis-ci.org/patrickpissurno/degust-cupom-txt.svg?branch=master)](https://travis-ci.org/patrickpissurno/degust-cupom-txt)\n[![coverage status](https://coveralls.io/repos/github/patrickpissurno/degust-cupom-txt/badge.svg?branch=master)](https://coveralls.io/github/patrickpissurno/degust-cupom-txt?branch=master)\n[![known vulnerabilities](https://snyk.io/test/github/patrickpissurno/degust-cupom-txt/badge.svg)](https://snyk.io/test/github/patrickpissurno/degust-cupom-txt)\n[![downloads](https://img.shields.io/npm/dt/degust-cupom-txt.svg)](https://www.npmjs.com/package/degust-cupom-txt)\n[![license](https://img.shields.io/github/license/patrickpissurno/degust-cupom-txt.svg?maxAge=1800)](https://github.com/patrickpissurno/degust-cupom-txt/blob/master/LICENSE)\n\nBiblioteca capaz de extrair os dados dos cupons .txt que o sistema de PDV Linx Degust emite.\n\n### Exemplo\n\nEntrada:\n```\n0V0010020000003200000000030000000000000020210131234559\n1202101310000000001N1000000030700101                          F00000000000000                                                                                                                        000000000600A00000000000000000000000000000000000020210131234559000000000000000 0         NOME TESTE                                             0000000000000  000006000000000000000000000000000000000000000000000000N\n2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         \n3A0010000000008               AGUA SEM GAS                                      UN    000001000000000006000000000600N                                        \n3B00001DINHEIRO                                000000600000000000000000                                                                                                                \n500000200000000010000000000000006000000000000060000000000000600\n9000001000002000007\n```\n\nSaída:\n```json\n{\n    \"loja_cnpj\": \"00000000000000\",\n    \"data\": \"2021-01-31\",\n    \"hora\": \"23:45:59\",\n    \"tipo_venda\": 1,\n    \"numero_abertura\": 1,\n    \"controle_interno\": 1,\n    \"controle_especifico\": 307,\n    \"codigo_pdv\": 1,\n    \"cancelada\": false,\n    \"forma_pagamento\": [\n        {\n            \"nome\": \"DINHEIRO\",\n            \"valor\": 6\n        }\n    ],\n    \"quantidade_total_de_produtos\": 1,\n    \"somatorio_valor_produtos\": 6,\n    \"somatorio_valor_unitario\": 6,\n    \"somatorio_valor_subtotal_item\": 6,\n    \"somatorio_valor_pagamento\": 6,\n    \"acrescimo_desconto\": null,\n    \"cliente\": null,\n    \"itens\": [\n        {\n            \"sequencia_item\": 1,\n            \"codigo\": 8,\n            \"nome\": \"AGUA SEM GAS\",\n            \"cancelado\": false,\n            \"quantidade\": 1,\n            \"valor_unitario\": 6,\n            \"subtotal_item\": 6,\n            \"observacao\": null\n        }\n    ]\n}\n```\n\n### Instalação\n```\nnpm install --save degust-cupom-txt\n```\n\n### Como usar\n```js\nconst fs = require('fs');\nconst parseCupom = require('degust-cupom-txt');\n\n/*\n    **** IMPORTANTE ****\n    Sempre utilize a opção encoding: 'latin1', pois é o encoding que o sistema\n    de PDV Linx Degust usa.\n*/\nconst txt = fs.readFileSync('./cupom.txt', { encoding: 'latin1' }).toString();\nconst venda = parseCupom(txt);\n```\n\n### Informações disponíveis\nObservação: muitos campos podem ser retornados como `null`, pois nem todos os dados são obrigatórios.\n\n```json\n{\n    \"loja_cnpj\": \"00000000000000\",\n    \"data\": \"2021-01-31\",\n    \"hora\": \"14:53:55\",\n    \"tipo_venda\": 8,\n    \"numero_abertura\": 1,\n    \"controle_interno\": 2,\n    \"controle_especifico\": 843,\n    \"codigo_pdv\": 1,\n    \"cancelada\": false,\n    \"forma_pagamento\": [\n        {\n            \"nome\": \"DINHEIRO\",\n            \"valor\": 41.01\n        }\n    ],\n    \"quantidade_total_de_produtos\": 4,\n    \"somatorio_valor_produtos\": 49,\n    \"somatorio_valor_unitario\": 49,\n    \"somatorio_valor_subtotal_item\": 49,\n    \"somatorio_valor_pagamento\": 41.01,\n    \"acrescimo_desconto\": {\n        \"tipo\": \"D\",\n        \"valor\": 7.99\n    },\n    \"cliente\": {\n        \"cpf\": \"00000000000\",\n        \"cnpj\": null,\n        \"email\": \"teste@exemplo.com\",\n        \"nome\": \"Nome Teste\",\n        \"telefone\": \"21988887777\",\n        \"sexo\": \"M\",\n        \"endereco\": {\n            \"logradouro\": \"Av. Lucio Costa\",\n            \"numero\": \"12060\",\n            \"complemento\": \"Bloco 7 Apto 101\",\n            \"bairro\": \"Barra da Tijuca\",\n            \"cep\": \"22000000\",\n            \"municipio\": \"RIO DE JANEIRO\",\n            \"uf\": \"RJ\",\n            \"referencia\": \"Prédios perto ao shopping center\"\n        },\n        \"observacao\": \"Alérgico a amendoim\",\n        \"data_nascimento\": \"1995-12-31\",\n        \"data_cadastro\": \"2020-12-14\"\n    },\n    \"itens\": [\n        {\n            \"sequencia_item\": 1,\n            \"codigo\": 2,\n            \"nome\": \"Lanche 1\",\n            \"cancelado\": false,\n            \"quantidade\": 1,\n            \"valor_unitario\": 49,\n            \"subtotal_item\": 49,\n            \"observacao\": null\n        },\n        {\n            \"sequencia_item\": 2,\n            \"codigo\": 80,\n            \"nome\": \"Acompanhamento 1\",\n            \"cancelado\": false,\n            \"quantidade\": 1,\n            \"valor_unitario\": 0,\n            \"subtotal_item\": 0,\n            \"observacao\": null\n        },\n        {\n            \"sequencia_item\": 3,\n            \"codigo\": 100,\n            \"nome\": \"Acompanhamento 3\",\n            \"cancelado\": false,\n            \"quantidade\": 1,\n            \"valor_unitario\": 0,\n            \"subtotal_item\": 0,\n            \"observacao\": \"Sem sal, por favor\"\n        },\n        {\n            \"sequencia_item\": 4,\n            \"codigo\": 212,\n            \"nome\": \"Bebida 4\",\n            \"cancelado\": false,\n            \"quantidade\": 1,\n            \"valor_unitario\": 0,\n            \"subtotal_item\": 0,\n            \"observacao\": null\n        }\n    ]\n}\n```\n\n### Documentação\nA biblioteca foi 100% documentada usando [@JSDoc](https://jsdoc.app/), de modo que IDEs possam oferecer autocomplete informativo, incluindo tipos e descrição dos campos.\nTestado e funcionando com [Visual Studio Code](https://code.visualstudio.com/).\n\n### Unit testing e coverage\nEsta biblioteca ainda não teve seus testes implementados, portanto deve ser considerada como experimental.\nOs testes serão implementados em breve, visando atingir 100% de cobertura (coverage).\n\n### Licença\n```\nAs marcas Linx® e Degust® são propriedades intelectuais\npertencentes à LINX SISTEMAS E CONSULTORIA LTDA.\n\nCNPJ: 54.517.628/0001-98\n\nTodos os direitos reservados.\n```\n\n**Este projeto não possui vínculos com a empresa Linx.**\n\n###### Licença sobre todo o código e artefatos desta biblioteca\n```\nMIT License\n\nCopyright (c) 2021 Patrick Pissurno\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpissurno%2Fdegust-cupom-txt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickpissurno%2Fdegust-cupom-txt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpissurno%2Fdegust-cupom-txt/lists"}