{"_id":"@adelant/ipp-browser","_rev":"1-06b9f2140b97178efa2803a559148b76","name":"@adelant/ipp-browser","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.2":{"name":"@adelant/ipp-browser","version":"1.0.2","keywords":["ipp","ipp-browser","print","web-print","web","browser"],"author":{"name":"Cristian Della Monica"},"license":"MIT","_id":"@adelant/ipp-browser@1.0.2","maintainers":[{"name":"angrigo","email":"gab.angrisani@gmail.com"}],"homepage":"https://github.com/adelantsoftware/ipp-browser#readme","bugs":{"url":"https://github.com/adelantsoftware/ipp-browser/issues"},"dist":{"shasum":"76af0c03a28669fdf4686159929731608fd7acd9","tarball":"https://registry.npmjs.org/@adelant/ipp-browser/-/ipp-browser-1.0.2.tgz","fileCount":3,"integrity":"sha512-RfjAyVGJu3vhhElxVF+7hUp0h+/vT9uNWwN3sidCOuWmesO8mBr0Xl5TwxwRJQuFmySstw/dc6ytbcAKKdexQw==","signatures":[{"sig":"MEQCIFm79HRWo95SFBeSx6FPGAElXGKjiNhhb2SJun0mcnaTAiBZwVTojBdv/a0EDaGWjN6+Jf9G8xPYi9+IG5R8h4SkKg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4806},"main":"./dist/ipp-browser.umd.cjs","type":"module","module":"./dist/ipp-browser.js","exports":{".":{"import":"./dist/ipp-browser.js","require":"./dist/ipp-browser.umd.cjs"}},"gitHead":"24caf61f0f26efd091ed774c522c59cfd5734d99","scripts":{"build":"npx vite build","start":"npx vite"},"_npmUser":{"name":"angrigo","email":"gab.angrisani@gmail.com"},"repository":{"url":"git+https://github.com/adelantsoftware/ipp-browser.git","type":"git"},"_npmVersion":"10.9.0","description":"ipp-browser is a powerful library that brings the power of Internet Printing Protocol (IPP) directly into the browser. With this library, you can easily integrate printing to IPP-compatible network devices directly from your web applications without havin","directories":{"lib":"lib"},"_nodeVersion":"22.12.0","dependencies":{"vite":"^6.1.0","react":"^19.0.0","buffer":"^6.0.3","lodash":"^4.17.21","ua-parser-js":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/react":"^19.0.8","@types/lodash":"^4.17.15","@types/react-dom":"^19.0.3","@types/ua-parser-js":"^0.7.39"},"_npmOperationalInternal":{"tmp":"tmp/ipp-browser_1.0.2_1739022040956_0.8150239683592362","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@adelant/ipp-browser","type":"module","main":"./dist/ipp-browser.umd.cjs","module":"./dist/ipp-browser.js","exports":{".":{"import":"./dist/ipp-browser.js","require":"./dist/ipp-browser.umd.cjs"}},"repository":{"type":"git","url":"git+https://github.com/adelantsoftware/ipp-browser.git"},"version":"1.0.3","description":"ipp-browser is a powerful library that brings the power of Internet Printing Protocol (IPP) directly into the browser. With this library, you can easily integrate printing to IPP-compatible network devices directly from your web applications without havin","scripts":{"build":"npx vite build","start":"npx vite"},"author":{"name":"Cristian Della Monica"},"license":"MIT","dependencies":{"buffer":"^6.0.3","lodash":"^4.17.21","react":"^19.0.0","vite":"^6.2.0"},"devDependencies":{"@types/lodash":"^4.17.16","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","typescript":"^5.8.2"},"bugs":{"url":"https://github.com/adelantsoftware/ipp-browser/issues"},"homepage":"https://github.com/adelantsoftware/ipp-browser#readme","directories":{"lib":"lib"},"keywords":["ipp","ipp-browser","print","web-print","web","browser"],"_id":"@adelant/ipp-browser@1.0.3","gitHead":"24caf61f0f26efd091ed774c522c59cfd5734d99","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-GgE1P8y+4+F1pVamo49zVzJ+mnvR6wLku8mZbpEJ6oUmDVXiT0RDhfBxp07JfIDXE3Fz/BiEwWhOk44VlJ3SjA==","shasum":"4ffc3bb1a8ccc96c520ac5299ea40ebf631889f4","tarball":"https://registry.npmjs.org/@adelant/ipp-browser/-/ipp-browser-1.0.3.tgz","fileCount":5,"unpackedSize":261533,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDcCyWJDcGGyoKtzDKu8lS89Reh8SDLMs1P+JZXixRyrQIhAIq91Jr2+KjzL9Cy4mWibodn/WYndF9iTbLly4A08Ha0"}]},"_npmUser":{"name":"angrigo","email":"gab.angrisani@gmail.com"},"maintainers":[{"name":"angrigo","email":"gab.angrisani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ipp-browser_1.0.3_1741023991220_0.9955630298702594"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-08T13:40:40.838Z","modified":"2025-03-03T17:46:31.629Z","1.0.2":"2025-02-08T13:40:41.124Z","1.0.3":"2025-03-03T17:46:31.437Z"},"bugs":{"url":"https://github.com/adelantsoftware/ipp-browser/issues"},"author":{"name":"Cristian Della Monica"},"license":"MIT","homepage":"https://github.com/adelantsoftware/ipp-browser#readme","keywords":["ipp","ipp-browser","print","web-print","web","browser"],"repository":{"type":"git","url":"git+https://github.com/adelantsoftware/ipp-browser.git"},"description":"ipp-browser is a powerful library that brings the power of Internet Printing Protocol (IPP) directly into the browser. With this library, you can easily integrate printing to IPP-compatible network devices directly from your web applications without havin","maintainers":[{"name":"angrigo","email":"gab.angrisani@gmail.com"}],"readme":"# ipp-browser\n\nIPP-browser is a powerful library that brings the power of Internet Printing Protocol (IPP) directly into the browser.\nInspired by the work of [William Kapke](https:///github.com/williamkapke/ipp), this library extends the use of IPP to the browser.\nWith this library, you can easily integrate printing to IPP-compatible network devices directly from your web applications without having to rely on additional plugins or software.\n\n## Installation\n\n​\n\n#### npm\n\n```sh\n$ npm install ipp-browser --save\n```\n\n​\n\n#### yarn\n\n```sh\n$ yarn add ipp-browser\n```\n\n​\n\n## API\n\n​\n​\n\n### Printer(url [,options])\n\nTo interact with a printer, create a `Printer` object.\n​\n**options:**\n\n- `charset` - Specifies the value for the 'attributes-charset' attribute of requests. Defaults to `utf-8`.\n- `language` - Specifies the value for the 'attributes-natural-language' attribute of requests. Defaults to `en-us`.\n- `uri` - Specifies the value for the 'printer-uri' attribute of requests. Defaults to `ipp://+url.host+url.path`.\n- `version` - Specifies the value for the 'version' attribute of requests. Defaults to `2.0`.\n  ​\n  ​\n\n### Printer.encodeMsg(operation, msg)\n\nConverts an IPP message object to IPP binary.\n​\n\n- 'operation' - There are many operations defined by IPP. See: [/lib/types.ts](https://github.com/adelantsoftware/ipp-browser/blob/main/lib/types.ts#L1).\n- 'message - A javascript object to be serealized into an IPP binary message.\n  ​\n  ​\n\n### Printer.getHeaders(headers?)\n\nReturns the heades to be included in your request\n​\n\n- 'headers' - The headers you want to add to the request.\n  ​\n  ​\n\n## Usage/Example\n\n#### Create a print request\n\n​\n\n```javascript\nimport Printer from '@adelant/ipp-browser';\nimport axios from 'axios';\n​\nlet url =\"http://192.168.x.y:631/ipp/print\"\n    let printer = new Printer(url);\n    let msg = {\n        \"operation-attributes-tag\": {\n            \"document-format\": \"image/jpeg\",\n        },\n        data: Buffer.from(imgBuff) ,\n      };\n​\naxios\n    .post(url, printer.encodeMsg(\"Print-Job\",msg), {\n        headers: printer.getHeaders(),\n    })\n    .then((response) => {\n        console.log(response)\n    });\n​\n```\n\n​\n\n## License\n\n​\nMIT\n","readmeFilename":"README.md"}