{"id":21681889,"url":"https://github.com/maythiwat/promptparse","last_synced_at":"2025-04-13T07:33:15.309Z","repository":{"id":63415660,"uuid":"567679498","full_name":"maythiwat/promptparse","owner":"maythiwat","description":"All-in-one JS library for PromptPay \u0026 EMVCo QR Codes","archived":false,"fork":false,"pushed_at":"2025-02-28T10:53:43.000Z","size":205,"stargazers_count":116,"open_issues_count":0,"forks_count":19,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T03:02:35.989Z","etag":null,"topics":["emvco","emvco-qr","promptpay","promptpay-qr","qrcode","thai-qr-payment","thai-qr-standard","truemoney"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/promptparse","language":"TypeScript","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/maythiwat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"maythiwat","ko_fi":"maythiwat","custom":"https://paypal.me/maythiwat"}},"created_at":"2022-11-18T10:20:54.000Z","updated_at":"2025-03-15T20:52:12.000Z","dependencies_parsed_at":"2024-04-23T11:09:36.752Z","dependency_job_id":"5acb4ee7-f16f-45e0-a4cf-fbd6ef749427","html_url":"https://github.com/maythiwat/promptparse","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":"0.20588235294117652","last_synced_commit":"b064b2b87768f0de1589ba6a88bbcbaa69da8c1d"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maythiwat%2Fpromptparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maythiwat%2Fpromptparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maythiwat%2Fpromptparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maythiwat%2Fpromptparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maythiwat","download_url":"https://codeload.github.com/maythiwat/promptparse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430863,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["emvco","emvco-qr","promptpay","promptpay-qr","qrcode","thai-qr-payment","thai-qr-standard","truemoney"],"created_at":"2024-11-25T15:32:08.853Z","updated_at":"2025-04-06T04:05:00.406Z","avatar_url":"https://github.com/maythiwat.png","language":"TypeScript","readme":"![PromptParse](https://github.com/maythiwat/promptparse/assets/23092256/889e8f80-b1b3-44b2-ace5-ffbbce6e673b)\n\n# PromptParse [![npm version](https://badge.fury.io/js/promptparse.svg)](https://badge.fury.io/js/promptparse)\n\n\"All-in-one JS library for PromptPay \u0026 EMVCo QR Codes\"\n\nNo dependency \u0026 Cross-platform. You can use it anywhere (Node.js, Deno, Bun), even in the browser!\n\n## Features\n\n- **Parse** \u0026mdash; PromptPay \u0026 EMVCo QR Code data strings into object\n- **Generate** \u0026mdash; QR Code data from pre-made templates (for example: PromptPay AnyID, PromptPay Bill Payment, TrueMoney, etc.)\n- **Manipulate** \u0026mdash; any values from parsed QR Code data (for example: transfer amount, account number) and encodes back into QR Code data\n- **Validate** \u0026mdash; checksum and data structure for known QR Code formats (for example: Slip Verify API Mini QR)\n\n## Usage\n\n### Parsing data and get value from tag\n\n```ts\nimport { parse } from 'promptparse'\n\n// Example data\nconst ppqr = parse('000201010211...')\n\n// Get Value of Tag ID '00'\nppqr.getTagValue('00') // Returns '01'\n```\n\n### Build QR data and append CRC tag\n\n```ts\nimport { encode, tag, withCrcTag } from 'promptparse'\n\n// Example data\nconst data = [\n  tag('00', '01'),\n  tag('01', '11'),\n  // ...\n]\n\n// Set CRC Tag ID '63'\nwithCrcTag(encode(data), '63') // Returns '000201010211...'\n```\n\n### Generate PromptPay Bill Payment QR\n\n```ts\nimport { billPayment } from 'promptparse/generate'\n\nconst payload = billPayment({\n  billerId: '1xxxxxxxxxxxx',\n  amount: 300.0,\n  ref1: 'INV12345',\n})\n\n// TODO: Create QR Code from payload\n```\n\n### Validate \u0026 extract data from Slip Verify QR\n\n```ts\nimport { slipVerify } from 'promptparse/validate'\n\nconst data = slipVerify('00550006000001...')\n\nif (!data) {\n  console.error('Invalid Payload')\n}\n\nconst { sendingBank, transRef } = data\n\n// TODO: Inquiry transaction from Bank Open API\n```\n\n### Convert BOT Barcode to PromptPay QR Tag 30 (Bill Payment)\n\n```ts\nimport { parseBarcode } from 'promptparse'\n\nconst botBarcode = parseBarcode('|310109999999901\\r...')\n\nif (!botBarcode) {\n  console.error('Invalid Payload')\n}\n\nconst payload = botBarcode.toQrTag30()\n\n// TODO: Create QR Code from payload\n```\n\n### Use on browser via CDN\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/promptparse\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n  ;(function () {\n    // Generate QR code payload (use function from \"promptparse\" global)\n    const payload = promptparse.generate.trueMoney({\n      mobileNo: '08xxxxxxxx',\n      amount: 10.0,\n      message: 'Hello World!',\n    })\n\n    // Quick \u0026 dirty way to show QR Code image\n    document.write(\n      `\u003cimg src=\"https://api.qrserver.com/v1/create-qr-code/?size=300x300\u0026data=${payload}\"\u003e`,\n    )\n  })()\n\u003c/script\u003e\n```\n\n## References\n\n- [EMV QR Code](https://www.emvco.com/emv-technologies/qrcodes/)\n- [Thai QR Payment Standard](https://www.bot.or.th/content/dam/bot/fipcs/documents/FPG/2562/ThaiPDF/25620084.pdf)\n- [Slip Verify API Mini QR Data](https://developer.scb/assets/documents/documentation/qr-payment/extracting-data-from-mini-qr.pdf)\n- [BOT Barcode Standard](https://www.bot.or.th/content/dam/bot/documents/th/our-roles/payment-systems/about-payment-systems/Std_Barcode.pdf)\n\n## See also\n\n- [phoomin2012/promptparse-php](https://github.com/phoomin2012/promptparse-php) PromptParse port for PHP\n\n## License\n\nThis project is MIT licensed (see [LICENSE.md](LICENSE.md))\n","funding_links":["https://github.com/sponsors/maythiwat","https://ko-fi.com/maythiwat","https://paypal.me/maythiwat"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaythiwat%2Fpromptparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaythiwat%2Fpromptparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaythiwat%2Fpromptparse/lists"}