{"id":50902970,"url":"https://github.com/stacksjs/ts-printers","last_synced_at":"2026-06-16T04:31:32.330Z","repository":{"id":344482496,"uuid":"1181967474","full_name":"stacksjs/ts-printers","owner":"stacksjs","description":"Interact with printers using TypeScript.","archived":false,"fork":false,"pushed_at":"2026-06-10T13:06:28.000Z","size":487,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T13:21:25.823Z","etag":null,"topics":["hp","ipp","printers"],"latest_commit_sha":null,"homepage":"","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","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},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2026-03-14T21:38:22.000Z","updated_at":"2026-06-10T11:51:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stacksjs/ts-printers","commit_stats":null,"previous_names":["stacksjs/ts-printers"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stacksjs/ts-printers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-printers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-printers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-printers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-printers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/ts-printers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-printers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34391702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hp","ipp","printers"],"created_at":"2026-06-16T04:31:31.081Z","updated_at":"2026-06-16T04:31:32.317Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.jpg\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# ts-printers\n\nA TypeScript library and CLI for interacting with printers via IPP (Internet Printing Protocol). Driver-based architecture with built-in HP support for firmware updates, printhead maintenance, and more.\n\n## Features\n\n- **Driver-Based Architecture** — Extensible driver system. HP driver built-in, generic IPP fallback for any printer\n- **IPP 2.0 Protocol** — Full binary encoding/decoding, zero external dependencies\n- **Network Discovery** — Find printers via mDNS/Bonjour, auto-detect vendor\n- **Firmware Updates** — Automated download, extraction, and installation from HP's servers\n- **Printer Maintenance** — Printhead cleaning (3 levels), alignment, diagnostic pages\n- **CLI \u0026 Library** — Use from the command line or import into your TypeScript project\n- **Standalone Binary** — Compile to a single executable for any platform\n\n## Install\n\n```bash\nbun install ts-printers\n```\n\n\u003e **Note:** `p7zip` is required for automated HP firmware updates: `brew install p7zip`\n\n## Get Started\n\n### Library\n\n```ts\nimport { Printer, discoverPrinters } from 'ts-printers'\n\n// Discover printers on the network\nconst printers = await discoverPrinters()\n\n// Connect and get status\nconst printer = new Printer('ipp://HP-Tango.local:631/ipp/print')\nconst status = await printer.status()\nconsole.log(`${status.model}: ${status.state}`)\nconsole.log(`Ink: ${status.markerNames.map((n, i) =\u003e `${n} ${status.markerLevels[i]}%`).join(', ')}`)\n\n// Print a file\nawait printer.printFile('./document.pdf', { copies: 2, quality: 'high' })\n\n// HP-specific: firmware \u0026 maintenance\nawait printer.updateFirmware(msg =\u003e console.log(msg))\nawait printer.clean('level1')\nawait printer.align()\n```\n\n### CLI\n\n```bash\n# Discovery\nprint discover\n\n# Printing\nprint status --printer ipp://printer:631/ipp/print\nprint send document.pdf --copies 2 --quality high\nprint jobs\nprint cancel 42\n\n# Firmware (HP)\nprint firmware --host 192.168.0.147\nprint firmware:update --host 192.168.0.147\n\n# Maintenance (HP)\nprint clean --host 192.168.0.147 --level 2\nprint align --host 192.168.0.147\nprint maintain --host 192.168.0.147\nprint diagnostic --host 192.168.0.147 --type quality\n```\n\n## Drivers\n\nts-printers uses a driver-based architecture. The right driver is auto-selected based on the printer model:\n\n| Feature | HP Driver | Generic IPP |\n|---------|-----------|-------------|\n| Printing \u0026 jobs | yes | yes |\n| Status \u0026 ink levels | yes | yes |\n| Firmware updates | yes | — |\n| Printhead cleaning | yes | — |\n| Alignment | yes | — |\n| Diagnostics | yes | — |\n| Power cycle | yes | — |\n\nAdd custom drivers for other manufacturers:\n\n```ts\nimport { registerDriver } from 'ts-printers'\n\nregisterDriver('Canon', matcher, factory)\n```\n\n## Configuration\n\nCreate a `print.config.ts` in your project root:\n\n```ts\nimport type { PrintConfig } from 'ts-printers'\n\nexport default {\n  defaultPrinter: 'ipp://HP-Tango.local:631/ipp/print',\n  verbose: false,\n} satisfies PrintConfig\n```\n\n## Tested Printers\n\n- **HP Tango X (Exclusive)** — fully tested (firmware, cleaning, diagnostics)\n- Any IPP-compatible printer — standard printing operations\n\n## Documentation\n\nFull documentation is available at [ts-printers.stacksjs.com](https://ts-printers.stacksjs.com).\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stacksjs/ts-printers/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/ts-printers/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n\"Software that is free, but hopes for a postcard.\" We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/ts-printers?style=flat-square\n[npm-version-href]: https://npmjs.com/package/ts-printers\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/ts-printers/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/ts-printers/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/ts-printers/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/ts-printers --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-printers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fts-printers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-printers/lists"}