{"id":40671766,"url":"https://github.com/receiptline/receiptio","last_synced_at":"2026-01-21T09:35:34.702Z","repository":{"id":57349143,"uuid":"439629259","full_name":"receiptline/receiptio","owner":"receiptline","description":"A print application for receipt printers, simple and easy with markdown, printer status support.","archived":false,"fork":false,"pushed_at":"2025-10-25T09:53:05.000Z","size":102,"stargazers_count":93,"open_issues_count":7,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-25T11:40:57.534Z","etag":null,"topics":["epson","escpos","impact","invoice","kiosk","kitchen","markdown","png","pos","printer","receipt","star","starprnt","svg","thermal","ticket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/receiptline.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-18T14:00:00.000Z","updated_at":"2025-10-25T09:53:01.000Z","dependencies_parsed_at":"2023-11-15T15:27:32.349Z","dependency_job_id":"88e05015-707b-4f6d-a99a-12ce379e758a","html_url":"https://github.com/receiptline/receiptio","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"371fed0c9215f7c20275f77ee97a3827242facc5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/receiptline/receiptio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receiptline%2Freceiptio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receiptline%2Freceiptio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receiptline%2Freceiptio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receiptline%2Freceiptio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/receiptline","download_url":"https://codeload.github.com/receiptline/receiptio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receiptline%2Freceiptio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["epson","escpos","impact","invoice","kiosk","kitchen","markdown","png","pos","printer","receipt","star","starprnt","svg","thermal","ticket"],"created_at":"2026-01-21T09:35:34.605Z","updated_at":"2026-01-21T09:35:34.680Z","avatar_url":"https://github.com/receiptline.png","language":"JavaScript","readme":"# ReceiptIO\r\n\r\nNode.js printing application for receipt printers, simple and easy with receipt markdown, printer status support.  \r\n\r\n```bash\r\n$ more example.receipt\r\n^^^RECEIPT\r\n\r\n12/18/2021, 11:22:33 AM\r\nAsparagus | 1| 1.00\r\nBroccoli  | 2| 2.00\r\nCarrot    | 3| 3.00\r\n---\r\n^TOTAL | ^6.00\r\n\r\n$ receiptio -d 192.168.192.168 -c 42 example.receipt\r\nsuccess\r\n```\r\n\r\n```javascript\r\nconst receiptio = require('receiptio');\r\n\r\nconst markdown = `^^^RECEIPT\r\n\r\n12/18/2021, 11:22:33 AM\r\nAsparagus | 1| 1.00\r\nBroccoli  | 2| 2.00\r\nCarrot    | 3| 3.00\r\n---\r\n^TOTAL | ^6.00`;\r\n\r\nreceiptio.print(markdown, '-d 192.168.192.168 -c 42').then(result =\u003e {\r\n    console.log(result);\r\n});\r\n```\r\n\r\n![receipt](example/example.png)  \r\n\r\n# Features\r\n\r\nReceiptIO is a simple printing application for receipt printers that prints with easy markdown data for receipts and returns printer status. Even without a printer, it can output images.  \r\n\r\nReceiptIO auto-detects printer models for seamless printing.  \r\n\r\nA development tool is provided to edit and preview the receipt markdown.  \r\nhttps://receiptline.github.io/receiptjs-designer/  \r\n\r\nThe details of the receipt markdown are explained at  \r\nhttps://github.com/receiptline/receiptline  \r\n\r\n# Receipt Printers\r\n\r\n- Epson TM series\r\n- Seiko Instruments RP series\r\n- Star MC series\r\n- Citizen CT series\r\n- Fujitsu FP series\r\n\r\nConnect with IP address, serial port, or Linux USB device file.  \r\n(LAN, Bluetooth SPP, USB with virtual serial port driver, ...)  \r\n\r\nEpson TM series (South Asia model) and Star MC series (StarPRNT model) can print with device font of Thai characters.  \r\n\r\n# Installation\r\n\r\n```bash\r\n$ npm install -g receiptio\r\n```\r\n\r\nFor USB connections on Linux, add a user to the `lp` group and reboot to access the device file.  \r\n\r\n```bash\r\n$ sudo gpasswd -a USER lp\r\n```\r\n\r\nIf serial port is used, [Node SerialPort](https://www.npmjs.com/package/serialport) is also required.  \r\n\r\n```bash\r\n$ npm install -g serialport\r\n```\r\n\r\nWhen using `-i` (print as image) or `-p png` (convert to png) option, [puppeteer](https://www.npmjs.com/package/puppeteer) or [sharp](https://www.npmjs.com/package/sharp) is also required.  \r\n\r\n```bash\r\n$ npm install -g puppeteer\r\n```\r\n\r\n```bash\r\n$ npm install -g sharp\r\n```\r\n\r\n[sharp](https://www.npmjs.com/package/sharp) is not support web fonts and minimizes the area of \"invert\" character decoration.  \r\n\r\n# Usage\r\n\r\n```console\r\n$ receiptio -h\r\n\r\nusage: receiptio [options] [source]\r\nsource:\r\n  receipt markdown text file\r\n  https://receiptline.github.io/designer/\r\n  if source is not present, standard input\r\noptions:\r\n  -h                show help\r\n  -d \u003cdestination\u003e  ip address or serial/usb port of target printer\r\n  -o \u003coutfile\u003e      file to output (if -d option is not present)\r\n                    if -d and -o are not present, standard output\r\n  -q [\u003cdevice\u003e]     inquire status (printer/drawer/drawer2) (default: printer)\r\n  -c \u003cchars\u003e        characters per line (24-96) (default: 48)\r\n  -u                upside down\r\n  -v                landscape orientation (for escpos/epson/sii/citizen/star)\r\n  -r \u003cdpi\u003e          print resolution for -v (180/203) (default: 203)\r\n  -s                paper saving (reduce line spacing)\r\n  -n                no paper cut\r\n  -m [\u003cl\u003e][,\u003cr\u003e]    print margin (left: 0-24, right: 0-24) (default: 0,0)\r\n  -i                print as image (requires puppeteer or sharp)\r\n  -b \u003cthreshold\u003e    image thresholding (0-255)\r\n  -g \u003cgamma\u003e        image gamma correction (0.1-10.0) (default: 1.0)\r\n  -t \u003ctimeout\u003e      print timeout (0-3600 sec) (default: 300)\r\n  -l \u003clanguage\u003e     language of source file (default: system locale)\r\n                    (en/fr/de/es/po/it/ru/ja/ko/zh-hans/zh-hant/th/...)\r\n  -p \u003cprinter\u003e      printer control language (default: auto detection)\r\n                    (escpos/epson/sii/citizen/fit/impact/impactb/generic/\r\n                     star/starline/emustarline/stargraphic/\r\n                     starimpact/starimpact2/starimpact3/svg/png/txt/text)\r\n                    (png requires puppeteer or sharp)\r\nprint results:\r\n  success(0), online(100), coveropen(101), paperempty(102),\r\n  error(103), offline(104), disconnect(105), timeout(106),\r\n  drawerclosed(200), draweropen(201)\r\nexamples:\r\n  receiptio -d com9 -q\r\n  receiptio -d COM1 example.receipt\r\n  receiptio -d /dev/usb/lp0 example.receipt\r\n  receiptio -d /dev/ttyS0 -u -b 160 example.receipt\r\n  receiptio -d 192.168.192.168 -c 42 example.receipt\r\n  receiptio example.receipt -o receipt.png\r\n  receiptio example.receipt -o receipt.txt\r\n  receiptio example.receipt -p escpos -i -b 128 -g 1.8 -o receipt.prn\r\n  receiptio \u003c example.receipt \u003e receipt.svg\r\n  echo {c:1234567890} | receiptio | more\r\n```\r\n\r\n## Command\r\n\r\n`receiptio [options] [source]`  \r\n\r\n## Parameters\r\n\r\n- Input\r\n  - `source`: receipt markdown text file\r\n    - https://receiptline.github.io/receiptjs-designer/\r\n  - if source is not found, standard input\r\n- Output\r\n  - `-d \u003cdestination\u003e`: ip address or serial/usb port of target printer\r\n  - `-o \u003coutfile\u003e`: file to output (if -d option is not found)\r\n  - if -d and -o are not found, standard output\r\n- Status\r\n  - `-q [\u003cdevice\u003e]`: inquire device status without printing\r\n    - `printer`: printer\r\n    - `drawer`: cash drawer\r\n    - `drawer2`: cash drawer with state invert\r\n    - default: `printer`\r\n- Width\r\n  - `-c \u003cchars\u003e`: characters per line\r\n    - range: `24`-`96`\r\n    - default: `48`\r\n- Orientation\r\n  - `-u`: upside down\r\n  - `-v`: landscape orientation (for `escpos`, `epson`, `sii`, `citizen`, `star`)\r\n  - `-r \u003cdpi\u003e`: print resolution for `-v`\r\n    - values: `180`, `203`\r\n    - default: `203`\r\n- Paper\r\n  - `-s`: paper saving (reduce line spacing)\r\n  - `-n`: no paper cut\r\n  - `-m [\u003cleft\u003e][,\u003cright\u003e]`: print margin\r\n    - range (left): `0`-`24`\r\n    - range (right): `0`-`24`\r\n    - default: `0,0`\r\n- Image\r\n  - `-i`: print as image (requires puppeteer or sharp)\r\n  - `-b \u003cthreshold\u003e`: image thresholding\r\n    - range: `0`-`255`\r\n  - `-g \u003cgamma\u003e`: image gamma correction\r\n    - range: `0.1`-`10.0`\r\n    - default: `1.0`\r\n- Others\r\n  - `-t \u003ctimeout\u003e`: print timeout (sec)\r\n    - range: `0`-`3600`\r\n    - default: `300`\r\n  - `-l \u003clanguage\u003e`: language of receipt markdown text\r\n    - `en`, `fr`, `de`, `es`, `po`, `it`, `ru`, ...: Multilingual (cp437, 852, 858, 866, 1252 characters)\r\n    - `ja`: Japanese (shiftjis characters)\r\n    - `ko`: Korean (ksc5601 characters)\r\n    - `zh-hans`: Simplified Chinese (gb18030 characters)\r\n    - `zh-hant`: Traditional Chinese (big5 characters)\r\n    - `th`: Thai\r\n    - default: system locale\r\n  - `-p \u003cprinter\u003e`: printer control language\r\n    - `escpos`: ESC/POS\r\n    - `epson`: ESC/POS (Epson)\r\n    - `sii`: ESC/POS (Seiko Instruments)\r\n    - `citizen`: ESC/POS (Citizen)\r\n    - `fit`: ESC/POS (Fujitsu)\r\n    - `impact`: ESC/POS (TM-U220)\r\n    - `impactb`: ESC/POS (TM-U220 Font B)\r\n    - `generic`: ESC/POS (Generic) _Experimental_\r\n    - `star`: StarPRNT\r\n    - `starline`: Star Line Mode\r\n    - `emustarline`: Command Emulator Star Line Mode\r\n    - `stargraphic`: Star Graphic Mode\r\n    - `starimpact`: Star Mode on dot impact printers _Experimental_\r\n    - `starimpact2`: Star Mode on dot impact printers (Font 5x9 2P-1) _Experimental_\r\n    - `starimpact3`: Star Mode on dot impact printers (Font 5x9 3P-1) _Experimental_\r\n    - `svg`: SVG\r\n    - `png`: PNG (requires puppeteer or sharp)\r\n    - `txt`: plain text\r\n    - `text`: plain text\r\n    - default: auto detection (`epson`, `sii`, `citizen`, `fit`, `impactb`, `generic`, `star`, `svg`, `png`, `txt`)\r\n\r\n## Return value\r\n\r\n- With `-d` option\r\n  - `success(0)`: printing success\r\n  - `online(100)`: printer is online\r\n  - `coveropen(101)`: printer cover is open\r\n  - `paperempty(102)`: no receipt paper\r\n  - `error(103)`: printer error (except cover open and paper empty)\r\n  - `offline(104)`: printer is off or offline\r\n  - `disconnect(105)`: printer is not connected\r\n  - `timeout(106)`: print timeout\r\n  - `drawerclosed(200)`: drawer is closed\r\n  - `draweropen(201)`: drawer is open\r\n- Without `-d` option\r\n  - printer commands or images\r\n\r\n# API\r\n\r\n## Print (Convert) API\r\n\r\n```javascript\r\n// async/await\r\nconst result = await receiptio.print(markdown, options);\r\nconsole.log(result);\r\n\r\n// promise\r\nreceiptio.print(markdown, options).then(result =\u003e {\r\n    console.log(result);\r\n});\r\n```\r\n\r\n### Method\r\n\r\n`receiptio.print(markdown[, options])`  \r\n\r\n### Parameters\r\n\r\n- `markdown` \u0026lt;string\u0026gt;\r\n  - receipt markdown text\r\n    - https://receiptline.github.io/designer/\r\n- `options` \u0026lt;string\u0026gt;\r\n  - `-d \u003cdestination\u003e`: ip address or serial/usb port of target printer\r\n    - Without `-d` option, the destination is the return value\r\n  - `-q [\u003cdevice\u003e]`: inquire device status without printing\r\n    - `printer`: printer\r\n    - `drawer`: cash drawer\r\n    - `drawer2`: cash drawer with state invert\r\n    - default: `printer`\r\n  - `-c \u003cchars\u003e`: characters per line\r\n    - range: `24`-`96`\r\n    - default: `48`\r\n  - `-m [\u003cleft\u003e][,\u003cright\u003e]`: print margin\r\n    - range (left): `0`-`24`\r\n    - range (right): `0`-`24`\r\n    - default: `0,0`\r\n  - `-u`: upside down\r\n  - `-v`: landscape orientation (for `escpos`, `epson`, `sii`, `citizen`, `star`)\r\n  - `-r \u003cdpi\u003e`:print resolution for `-v`\r\n    - values: `180`, `203`\r\n    - default: `203`\r\n  - `-s`: paper saving (reduce line spacing)\r\n  - `-n`: no paper cut\r\n  - `-i`: print as image (requires puppeteer or sharp)\r\n  - `-b \u003cthreshold\u003e`: image thresholding\r\n    - range: `0`-`255`\r\n  - `-g \u003cgamma\u003e`: image gamma correction\r\n    - range: `0.1`-`10.0`\r\n    - default: `1.0`\r\n  - `-t \u003ctimeout\u003e`: print timeout (sec)\r\n    - range: `0`-`3600`\r\n    - default: `300`\r\n  - `-l \u003clanguage\u003e`: language of receipt markdown text\r\n    - `en`, `fr`, `de`, `es`, `po`, `it`, `ru`, ...: Multilingual (cp437, 852, 858, 866, 1252 characters)\r\n    - `ja`: Japanese (shiftjis characters)\r\n    - `ko`: Korean (ksc5601 characters)\r\n    - `zh-hans`: Simplified Chinese (gb18030 characters)\r\n    - `zh-hant`: Traditional Chinese (big5 characters)\r\n    - `th`: Thai\r\n    - default: system locale\r\n  - `-p \u003cprinter\u003e`: printer control language\r\n    - `escpos`: ESC/POS\r\n    - `epson`: ESC/POS (Epson)\r\n    - `sii`: ESC/POS (Seiko Instruments)\r\n    - `citizen`: ESC/POS (Citizen)\r\n    - `fit`: ESC/POS (Fujitsu)\r\n    - `impact`: ESC/POS (TM-U220)\r\n    - `impactb`: ESC/POS (TM-U220 Font B)\r\n    - `generic`: ESC/POS (Generic) _Experimental_\r\n    - `star`: StarPRNT\r\n    - `starline`: Star Line Mode\r\n    - `emustarline`: Command Emulator Star Line Mode\r\n    - `stargraphic`: Star Graphic Mode\r\n    - `starimpact`: Star Mode on dot impact printers _Experimental_\r\n    - `starimpact2`: Star Mode on dot impact printers (Font 5x9 2P-1) _Experimental_\r\n    - `starimpact3`: Star Mode on dot impact printers (Font 5x9 3P-1) _Experimental_\r\n    - `svg`: SVG\r\n    - `png`: PNG (requires puppeteer or sharp)\r\n    - `txt`: plain text\r\n    - `text`: plain text\r\n    - default: auto detection (`epson`, `sii`, `citizen`, `fit`, `impactb`, `generic`, `star`, `svg`, `png`, `txt`)\r\n\r\n### Return value\r\n\r\n- With `-d` option \u0026lt;string\u0026gt;\r\n  - `success`: printing success\r\n  - `online`: printer is online\r\n  - `coveropen`: printer cover is open\r\n  - `paperempty`: no receipt paper\r\n  - `error`: printer error (except cover open and paper empty)\r\n  - `offline`: printer is off or offline\r\n  - `disconnect`: printer is not connected\r\n  - `timeout`: print timeout\r\n  - `drawerclosed`: drawer is closed\r\n  - `draweropen`: drawer is open\r\n- Without `-d` option \u0026lt;string\u0026gt;\r\n  - printer commands or images\r\n\r\n## Transform stream API\r\n\r\n`receiptio.createPrint()` method is the stream version of the `receiptio.print()`.  \r\n\r\n```javascript\r\nconst fs = require('fs');\r\nconst receiptio = require('receiptio');\r\n\r\nconst source = fs.createReadStream('example.receipt');\r\nconst transform = receiptio.createPrint('-p svg');\r\nconst destination = fs.createWriteStream('example.svg');\r\n\r\nsource.pipe(transform).pipe(destination);\r\n```\r\n\r\n### Method\r\n\r\n`receiptio.createPrint([options])`  \r\n\r\n### Parameters\r\n\r\n- `options` \u0026lt;string\u0026gt;\r\n\r\n### Return value\r\n\r\n- Transform stream \u0026lt;stream.Transform\u0026gt;\r\n\r\n# Serial port options\r\n\r\n```\r\n-d COM1:115200,N,8,1\r\n```\r\n\r\n- `-d \u003cdestination\u003e`\r\n  - the system path of the serial port\r\n  - `\u003csystem path\u003e[:\u003coptions\u003e]`\r\n- `\u003coptions\u003e`\r\n  - `\u003cbaud rate\u003e,\u003cparity\u003e,\u003cdata bits\u003e,\u003cstop bits\u003e[,\u003cflow control\u003e]`\r\n  - default: `115200,N,8,1,N`\r\n  - commas can be omitted\r\n- `\u003cbaud rate\u003e`\r\n  - `2400`, `4800`, `9600`, `19200`, `38400`, `57600`, `115200`\r\n- `\u003cparity\u003e`\r\n  - `N`: none, `E`: even, `O`: odd\r\n- `\u003cdata bits\u003e`\r\n  - `8`, `7`\r\n- `\u003cstop bits\u003e`\r\n  - `1`, `2`\r\n- `\u003cflow control\u003e`\r\n  - `N`: none, `R`: rts/cts, `X`: xon/xoff\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freceiptline%2Freceiptio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freceiptline%2Freceiptio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freceiptline%2Freceiptio/lists"}