{"_id":"@achyutlabsau/cashdrawer","_rev":"4-e5839903939394729e01e75e2435adbf","name":"@achyutlabsau/cashdrawer","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.1":{"name":"@achyutlabsau/cashdrawer","version":"0.1.1","keywords":["cashdrawer","printer","node-printer","open-cashdrawer"],"author":{"name":"Achyutlabs pty ltd."},"license":"MIT","_id":"@achyutlabsau/cashdrawer@0.1.1","maintainers":[{"name":"achyutlab","email":"achyutlabs@gmail.com"},{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"}],"dist":{"shasum":"d4cce3c154fdbfca8be0db73945c830510cb0428","tarball":"https://registry.npmjs.org/@achyutlabsau/cashdrawer/-/cashdrawer-0.1.1.tgz","fileCount":10,"integrity":"sha512-vn+itUQSStKe7tYrZ0Wuk9Rt+rRtlxghSqcatkGznPwgpWtuCEI2rK5yRJrfMeVt6wNbcbtQ6YjIYdC6p/z/Ew==","signatures":[{"sig":"MEQCIC4stB4bvhaynGyHrBIHQogq26a1aFMIo9F79/34/k9pAiAwIise0q0lTJmOrHHecStfRliynMMvvmhS1p8zov8Zcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145179},"main":"index.js","types":"index.d.ts","binary":{"napi_versions":[8]},"gitHead":"bcc19873d42820739602f9016e997f6695e09129","gypfile":true,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","clean":"git clean -fx ./build ./prebuilds ./node_modules","install":"node-gyp-build","prebuild":"prebuildify --napi --strip --name node.napi"},"_npmUser":{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"},"_npmVersion":"10.9.0","description":"A utility to open a cash drawer with specified printer","directories":{},"_nodeVersion":"22.11.0","dependencies":{"node-addon-api":"^8.2.2","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/cashdrawer_0.1.1_1733749930962_0.5704476466472386","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@achyutlabsau/cashdrawer","version":"0.1.3","keywords":["cashdrawer","printer","node-printer","open-cashdrawer"],"author":{"name":"Achyutlabs pty ltd."},"license":"MIT","_id":"@achyutlabsau/cashdrawer@0.1.3","maintainers":[{"name":"achyutlab","email":"achyutlabs@gmail.com"},{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"}],"dist":{"shasum":"22c3d04f757f92e26505b611834feba351c0561a","tarball":"https://registry.npmjs.org/@achyutlabsau/cashdrawer/-/cashdrawer-0.1.3.tgz","fileCount":10,"integrity":"sha512-HJbQAw1ILiNkHpPQ22/twTrmxn2J5V7B0lZnwEBiwBfT/LNG2Li6/dji1YtjFYNAZHklLzXbE6GWoHFSrtJ54g==","signatures":[{"sig":"MEYCIQDY86dlLWxR20i0hcc6+QOXFjsQPUtPw0EkU56e+f+NjQIhAOVgpjpHDK5PomzliqT24QPb06rHRNoWnAim+tIB8feG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145245},"main":"index.js","types":"index.d.ts","binary":{"napi_versions":[8]},"gitHead":"a2456180077479cfbf41f766f5be2cba4a73b217","gypfile":true,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","clean":"git clean -fx ./build ./prebuilds ./node_modules","install":"node-gyp-build","prebuild":"prebuildify --napi --strip --name node.napi"},"_npmUser":{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"},"_npmVersion":"10.9.0","description":"A utility to open a cash drawer with specified printer","directories":{},"_nodeVersion":"22.11.0","dependencies":{"node-addon-api":"^8.2.2","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/cashdrawer_0.1.3_1735276673976_0.9716097266400556","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@achyutlabsau/cashdrawer","version":"0.1.4","keywords":["cashdrawer","printer","node-printer","open-cashdrawer"],"author":{"name":"Achyutlabs pty ltd."},"license":"MIT","_id":"@achyutlabsau/cashdrawer@0.1.4","maintainers":[{"name":"achyutlab","email":"achyutlabs@gmail.com"},{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"}],"dist":{"shasum":"0a1894faa3cc4a1e30964bd42471a99ab87cb9fe","tarball":"https://registry.npmjs.org/@achyutlabsau/cashdrawer/-/cashdrawer-0.1.4.tgz","fileCount":10,"integrity":"sha512-5zonzXX7MFEzEcfm+S4hPsOhpdRqjjJ9KPNx3pss0zVbeWKbYqGDaaJaw7jPDsRs3lBv67VBbe8e0fC6ae6ThA==","signatures":[{"sig":"MEYCIQDe6aN2CVvMXrPFGdzKrRoKnaemkFyJKcXaMUcu0rMGWAIhAOak97L0+Mjyaj+a4Pd6h/YvtWgTn885zLdS9yNO/6D7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":149119},"main":"index.js","types":"index.d.ts","binary":{"napi_versions":[8]},"gitHead":"02dcda677fb999dde1be7362879d90791c57e467","gypfile":true,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","clean":"git clean -fx ./build ./prebuilds ./node_modules","install":"node-gyp-build","prebuild":"prebuildify --napi --strip --name node.napi"},"_npmUser":{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"},"_npmVersion":"11.4.1","description":"A utility to open a cash drawer with specified printer","directories":{},"_nodeVersion":"22.11.0","dependencies":{"node-addon-api":"^8.2.2","node-gyp-build":"^4.8.2"},"_hasShrinkwrap":false,"devDependencies":{"prebuildify":"^6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/cashdrawer_0.1.4_1749186355651_0.7244928946296263","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@achyutlabsau/cashdrawer","version":"0.1.5","description":"A utility to open a cash drawer with specified printer","author":{"name":"Achyutlabs pty ltd."},"license":"MIT","main":"index.js","types":"index.d.ts","scripts":{"test":"node test.js","install":"node-gyp-build","prebuild":"prebuildify --napi --strip --name node.napi","prebuild-all":"node scripts/build.js","clean":"git clean -fx ./build ./prebuilds ./node_modules"},"dependencies":{"node-addon-api":"^8.3.1","node-gyp-build":"^4.8.4"},"devDependencies":{"prebuildify":"^6.0.1"},"keywords":["cashdrawer","printer","node-printer","open-cashdrawer","pos","receipt-printer","escpos"],"gypfile":true,"binary":{"napi_versions":[8]},"engines":{"node":">=16.0.0"},"os":["win32","darwin","linux"],"cpu":["x64","arm64"],"repository":{"type":"git","url":"git+https://github.com/achyutlabsau/cashdrawer.git"},"bugs":{"url":"https://github.com/achyutlabsau/cashdrawer/issues"},"homepage":"https://github.com/achyutlabsau/cashdrawer#readme","_id":"@achyutlabsau/cashdrawer@0.1.5","gitHead":"c8ae1ceee0fc32838c8349eee0f4a910b0e5efc5","_nodeVersion":"22.11.0","_npmVersion":"11.4.1","dist":{"integrity":"sha512-G9mDJTgIVTpu+bgjT7qC8J74J8b1OC32B9CCr+llKo7gZMCu+rFRzwn36wcJluhpMUmOY6wGRXdiLTtvE1NfHA==","shasum":"650a03eaf66efc438e712389e0c7710147bcf30e","tarball":"https://registry.npmjs.org/@achyutlabsau/cashdrawer/-/cashdrawer-0.1.5.tgz","fileCount":14,"unpackedSize":263698,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC/5lbwY5xZVytkBMJET1GEpaS5QL18Z/1oE95/wpVj9wIhANXy8KzrrTC1r7Wd8cxL8SWKFcNbSGFMj3OhhvqdtFq0"}]},"_npmUser":{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"},"directories":{},"maintainers":[{"name":"achyutlab","email":"achyutlabs@gmail.com"},{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cashdrawer_0.1.5_1749188935140_0.2871961325565735"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-09T13:12:10.830Z","modified":"2025-06-06T05:48:55.528Z","0.1.1":"2024-12-09T13:12:11.141Z","0.1.3":"2024-12-27T05:17:54.142Z","0.1.4":"2025-06-06T05:05:55.891Z","0.1.5":"2025-06-06T05:48:55.318Z"},"author":{"name":"Achyutlabs pty ltd."},"license":"MIT","keywords":["cashdrawer","printer","node-printer","open-cashdrawer","pos","receipt-printer","escpos"],"description":"A utility to open a cash drawer with specified printer","maintainers":[{"name":"achyutlab","email":"achyutlabs@gmail.com"},{"name":"achyutlabs","email":"raghav.yadav@achyutlabs.com"}],"readme":"# @achyutlabsau/cashdrawer\r\n\r\nA simple Node.js library to open a cash drawer connected through a specified printer. Ideal for POS systems that need to trigger cash drawers programmatically.\r\n\r\n## Installation\r\n\r\nInstall via npm:\r\n\r\n```bash\r\nnpm install @achyutlabsau/cashdrawer\r\n```\r\n\r\n## Usage\r\n\r\nThis package lets you open a cash drawer by specifying the printer's name associated with the cash drawer. The drawer will trigger based on the standard escape command sent to the printer.\r\n\r\n### Import the Module\r\n\r\n```javascript\r\n// ESM\r\nimport { openCashDrawer } from '@achyutlabsau/cashdrawer';\r\n\r\n// Common JS\r\nconst { openCashDrawer } = require('@achyutlabsau/cashdrawer');\r\n```\r\n\r\n### Open the Cash Drawer\r\n\r\nTo open the cash drawer, call the `openCashDrawer` function and pass the name of the printer connected to your cash drawer.\r\n\r\n```javascript\r\nopenCashDrawer(\"your-printer-name\");\r\n```\r\n\r\n### Example\r\n\r\n```javascript\r\nimport { openCashDrawer } from '@achyutlabsau/cashdrawer';\r\n\r\nconst printerName = 'EPSON_TM_T20III';\r\n\r\nconst result = openCashDrawer(printerName)\r\n\r\nif(!result.success) {\r\n  console.log(result.errorMessage)\r\n} else {\r\n console.log('Cash drawer opened successfully!')\r\n}\r\n\r\n```\r\n\r\n## API\r\n\r\n### `openCashDrawer(printerName: string): OpenCashDrawerResult`\r\n\r\n- **printerName** (string) - The name of the printer connected to the cash drawer. This should match the exact name your system uses for the printer.\r\n\r\n- **Returns**: an object with the following properties:\r\n  - success (boolean): Indicates whether the cash drawer opened successfully.\r\n  - errorMessage (string): A description of the error if the operation failed.\r\n  - errorCode (DrawerErrorCodes): A specific error code representing the type of failure.\r\n\r\n\r\n### Get Available Printers\r\nThe `getAvailablePrinters` function returns a list of printers available on the system. This is useful for identifying the exact name of the printer connected to your cash drawer.\r\n\r\n```javascript\r\nimport { getAvailablePrinters } from '@achyutlabsau/cashdrawer';\r\n\r\nconst printers = getAvailablePrinters();\r\nconsole.log('Available Printers:', printers);\r\n```\r\n## Supported Printers\r\n\r\nThis package has been tested with printers that support ESC/POS commands, such as:\r\n\r\n- EPSON TM Series\r\n- Star TSP Series\r\n\r\n## Contributing\r\n\r\nContributions are welcome! If you encounter a bug or have a feature request, please open an issue on GitHub.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n","readmeFilename":"README.md","homepage":"https://github.com/achyutlabsau/cashdrawer#readme","repository":{"type":"git","url":"git+https://github.com/achyutlabsau/cashdrawer.git"},"bugs":{"url":"https://github.com/achyutlabsau/cashdrawer/issues"}}