{"_id":"@dailykit/xml-escpos-helper","_rev":"3-65e3910601af342233b418070ee15bce","name":"@dailykit/xml-escpos-helper","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@dailykit/xml-escpos-helper","description":"ESC/POS with XML interface","keywords":["escpos","esc","pos","xml","printer"],"version":"1.0.0","main":"lib/index","types":"lib","engines":{"node":">=4.0.0"},"license":"Apache-2.0","scripts":{"build":"yarn  clean && yarn  compile","build:watch":"yarn compile -- -w","clean":"rm -rf ./lib && rm -rf tsconfig.build.tsbuildinfo","compile":"tsc -p ./tsconfig.build.json"},"repository":{"type":"git","url":"git+https://github.com/dailykit/xml-escpos-helper.git"},"contributors":[{"name":"Snehit Velma","email":"snehithvelma@gmail.com"}],"bugs":{"url":"https://github.com/dailykit/xml-escpos-helper/issues"},"dependencies":{"arabic-persian-reshaper":"^1.0.1","buffer":"^6.0.3","iconv-lite":"^0.6.3","mustache":"^4.1.0","mutable-buffer":"2.0.3","ndarray":"^1.0.19","pngjs":"^6.0.0","xml-parser":"^1.2.1"},"devDependencies":{"@types/node":"^14.14.20","@types/xml-parser":"^1.2.29","ts-loader":"^2.3.4","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typescript":"^4.1.3"},"gitHead":"f56139d2a0bc3c92fee483e0ba9ccd92dd415daf","homepage":"https://github.com/dailykit/xml-escpos-helper#readme","_id":"@dailykit/xml-escpos-helper@1.0.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-srcbbhBz9LOznzXZ+fej5qzNHNoMCnnmlnAyprwpnU4W4VzJ9ovZ8aFA5RsFAyh+EKReDln7+VXtfnNi9vz4jQ==","shasum":"26436f4cfc344bff8d71103a676c96f79b093f0d","tarball":"https://registry.npmjs.org/@dailykit/xml-escpos-helper/-/xml-escpos-helper-1.0.0.tgz","fileCount":53,"unpackedSize":77269,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChgetJis1C3kRHGYXdoVED81Rz6EtHuhf0sfrHKKpqrgIgGgVm2MdTozuR5lh2L2V2mkzluXVdHSIAX7gbTf+RGZI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaO96ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqICQ/9EMQqiq07ulbHaEorP56lL+JvmbUCP/qq/dGe1xdzmg5/RwMC\r\nueCYaKiDQzdffphL/KBhPKUbzaEC9YFg8q53DQdhKxej6htuvksme0BR03Gl\r\ndll8fzJOev7fzMtTEOCJP0zLhK+3j0ILGzaoYnJ71WvATpBE0VKwucSTW6tJ\r\nwrdjr1jiPFuYYEUNADBXBFEj7Exs6G2z5dqwrr97QuA3ODgt5YlMKI4PyHzh\r\n+th+Atw6iKd6cylV82uZC5UZ9VS9zPVCq7PVZVmW9fanQ8tavs2D0JyS8MKW\r\nb09dURb7qwYgNBQF/XkruszLX9uh7T6U/+GULyGwbtvb3WeY4EPzNgM4CRyP\r\nzhsM29ge7QarbA9MlN8IEP6ZbrBsI5VSN6eTuV8EHVgDNnpoaMCRMCEnNk/Z\r\nopAOmaODpY6UolfFYpdwttZuRXMBnwlh2FcaFlMPBKIOO9qBoNmR2sg/ZdFr\r\nXvbgqJCBgc9NY4Cd+70uoki7bEPAj+nhex0xwDMtmd4bcLbNNmYB/vZ/bMdY\r\nPl+WqpMssR0BIDiOSp+YuGotfDqNfNPlYRTakeY90DbbIzpww4nVHflnWe1q\r\n/NTDjJVkP3cwncoDEY8qTUehO4uqWkbHkFXRGej7LuJOfQ20y+tODr+ewuzv\r\n+T4e/0ZWcVgErdwMqTEQUdNifOWtLSt3WcE=\r\n=G1Tg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"st.deepak15","email":"st.deepak15@gmail.com"},"directories":{},"maintainers":[{"name":"sanjeev-dailykit","email":"sanjeev@dailykit.org"},{"name":"rishisinghal92","email":"rishisinghal92@gmail.com"},{"name":"prvnbist","email":"prvnbist@gmail.com"},{"name":"st.deepak15","email":"st.deepak15@gmail.com"},{"name":"siddhantk232","email":"siddhantk232@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-escpos-helper_1.0.0_1651044218258_0.9121429824919345"},"_hasShrinkwrap":false},"1.0.1":{"name":"@dailykit/xml-escpos-helper","description":"ESC/POS with XML interface","keywords":["escpos","esc","pos","xml","printer"],"version":"1.0.1","main":"lib/index","types":"lib","engines":{"node":">=4.0.0"},"license":"Apache-2.0","scripts":{"build":"yarn  clean && yarn  compile","build:watch":"yarn compile -- -w","clean":"rm -rf ./lib && rm -rf tsconfig.build.tsbuildinfo","compile":"tsc -p ./tsconfig.build.json"},"repository":{"type":"git","url":"git+https://github.com/dailykit/xml-escpos-helper.git"},"contributors":[{"name":"Snehit Velma","email":"snehithvelma@gmail.com"}],"bugs":{"url":"https://github.com/dailykit/xml-escpos-helper/issues"},"dependencies":{"arabic-persian-reshaper":"^1.0.1","buffer":"^6.0.3","iconv-lite":"^0.6.3","mustache":"^4.1.0","mutable-buffer":"2.0.3","ndarray":"^1.0.19","pngjs":"^6.0.0","xml-parser":"^1.2.1"},"devDependencies":{"@types/node":"^14.14.20","@types/xml-parser":"^1.2.29","ts-loader":"^2.3.4","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typescript":"^4.1.3"},"gitHead":"75a864849d210e311339472ed52d07995257d89c","homepage":"https://github.com/dailykit/xml-escpos-helper#readme","_id":"@dailykit/xml-escpos-helper@1.0.1","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4WlG1d5aUX0DkCjQ3IYpoKZdbDuXUz2ynDYZnxd4OodvSGOKiKaE9dro+d4UqBdGQzDdVl24YQI+5K2NLgp7AA==","shasum":"e012db3ca5d10492ea3c0fb19663287b7924b65a","tarball":"https://registry.npmjs.org/@dailykit/xml-escpos-helper/-/xml-escpos-helper-1.0.1.tgz","fileCount":53,"unpackedSize":77612,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbkYaeBe24jQl2oBxzc805k1jYgiiNx6Z/c/Q0dlQtOQIhANpnIO+ebWSkveuDWkqN6tSosA9eF2bdmIBma+dtPL6e"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaPN+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBdxAAjWYd+gyAF6kjLVeEDqVNb6F15jzJi9rfitycgOlF7ObwRMwv\r\n4SzarRNm75C9C9PWMQXSFyFXncOM1odriixGkOoO6/PyOrDXmWXm++F1Arub\r\nXrqL4HIGXdvFLIs3itE2GuMMyXbMV0YGKv8nTEOGrn0LjuMQSObFgVEPnDfM\r\n2REYGSNB4J6OqK9bo7OXAUHUsWhBVvJqt5LAdjfaqmPYFwTKwO5PmafsqGQ+\r\nw/Oa6RJZfZQcQEjyxhdJZqKcGV00c1x2F3f75aWdnYwPMFO+98V2RwDvMSf8\r\nHVNQXWZknd/UHSnJijrdXnzm2ccqtqViFWq/PAzSR6Ir5EIlKY2QTKUXBBB4\r\n1lRWzFURcZuGDjdFglzsY8WgO2luL3KF47HVx7D15EosNN57cxw3tRTkVkSW\r\n8vr7j8NbH1ZTR/hw4Wx0p9hDtp/0mTpNY/C712RngtdTmURAbRGH/8A2VRlD\r\n4LIe6RykoH9SkoBTCiZjAhS5/7zV3/hPgiHdKq6y83Rgh5l7vc2zo7325zeL\r\nu5CbE+slppHFlbYvR9OG55yTWiBRFt64NuI3CPhUyeQujdycN9Dq92/BAJYe\r\nGsneRd73vJBubnb63Qm/LkU6RfzsXUUmOy7gVrLS0zHb8YXr1yJVcxrO5PuT\r\njC2DbrhrWosXaff6Vtg4g9aAJNcxSDCp67k=\r\n=R6FQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"st.deepak15","email":"st.deepak15@gmail.com"},"directories":{},"maintainers":[{"name":"sanjeev-dailykit","email":"sanjeev@dailykit.org"},{"name":"rishisinghal92","email":"rishisinghal92@gmail.com"},{"name":"prvnbist","email":"prvnbist@gmail.com"},{"name":"st.deepak15","email":"st.deepak15@gmail.com"},{"name":"siddhantk232","email":"siddhantk232@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-escpos-helper_1.0.1_1651045246408_0.5860047737934704"},"_hasShrinkwrap":false},"1.0.2":{"name":"@dailykit/xml-escpos-helper","description":"ESC/POS with XML interface","keywords":["escpos","esc","pos","xml","printer"],"version":"1.0.2","main":"lib/index","types":"lib","engines":{"node":">=4.0.0"},"license":"Apache-2.0","scripts":{"build":"yarn  clean && yarn  compile","build:watch":"yarn compile -- -w","clean":"rm -rf ./lib && rm -rf tsconfig.build.tsbuildinfo","compile":"tsc -p ./tsconfig.build.json"},"repository":{"type":"git","url":"git+https://github.com/dailykit/xml-escpos-helper.git"},"contributors":[{"name":"Deepak Negi","email":"st.deepak15@gmail.com"}],"bugs":{"url":"https://github.com/dailykit/xml-escpos-helper/issues"},"dependencies":{"arabic-persian-reshaper":"^1.0.1","buffer":"^6.0.3","iconv-lite":"^0.6.3","mustache":"^4.1.0","mutable-buffer":"2.0.3","ndarray":"^1.0.19","pngjs":"^6.0.0","slice-ansi":"4.0.0","strip-ansi":"6.0.1","xml-parser":"^1.2.1"},"devDependencies":{"@types/node":"^14.14.20","@types/slice-ansi":"^5.0.0","@types/xml-parser":"^1.2.29","ts-loader":"^2.3.4","ts-node":"^10.7.0","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typescript":"^4.1.3"},"gitHead":"ce67f572511f7ad562cc0ca081b69605e7cd4175","homepage":"https://github.com/dailykit/xml-escpos-helper#readme","_id":"@dailykit/xml-escpos-helper@1.0.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ZFc7AlIU+j5BPlE0nsydBmBQwXchhijJ6Uncb/+iWoXrIaLeQgy2Iy7gIQ9gQi6OCSlxs+m5dyBdklOG//wSZA==","shasum":"d829cc93bacfee298d3b474ec87348701f90a9f7","tarball":"https://registry.npmjs.org/@dailykit/xml-escpos-helper/-/xml-escpos-helper-1.0.2.tgz","fileCount":55,"unpackedSize":81420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwtNMyqwj3MAWgmuaoEu5CJc8eg/imiBD5WYbakhKEMAiEAkn/doZmZu7yyUsKeJqUVN9u3vbxzaxI4hUpDBJwhwcg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJia4hOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCxQ/+KU4t+5BeuhzZ4LyQYPpSByWFbhVG6e9p6PnZ4YMwr6vRxdQd\r\nyqbWEJMgU12iMhae8ojXz8vTzB5Y2nn26iv1B48KxE3qAWcjQzZuXbmwWe48\r\nV9/kYx/RAAQc5BM0MkvF69UppgjllloHJE9QIX/ZFHF6o4BzEDKGVYu9YN/0\r\nC/MV6LnQNZvGzZGrCgiKxjriZAQ6LU+MwBWRrl9rZjQrTgMCpQcKd5DmH93P\r\nglzkwC7O6+DtFuEETt9UCJZmC7paKnY8Kv1BwZwlD5/vtNQwEqnmisQfIFIM\r\nXqnoCda7jyKXSmzacNTNhkoKWUFVGmm7bFtIR+WIzrsaYe17lmkCjRNZsj3B\r\nQPWkq+CMjK9z9JNH7wrymOJbRVhhqbEpbEG3nBw/IXXZ9sgUnar7XKxySixC\r\nc+2HIn364cK8DWBb3YDArtNI1Cc+WgkeIgn61yBR2m5lsXsfuRrz2/qIvu2q\r\nIRIiO190i4uxcPYkMxt/74M3orJH2O/n9XMLX7QGxUczq0rsSq6uXmMted0w\r\nwK5Fguf6EJuEJslb+U1kbMnun7oiyJOPtAgGxkMVqEdz9S8Qwv37PaSDFn8o\r\npUkCR8aodMUL4vT3nULAJA+ijXi06s9X1cnGuBCsncBbGLtU1Hb18V/jlHKq\r\n9Mdnv1jDXMsuYGIDz8KTqNcFZe5Z8SsvLs8=\r\n=g9eg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"st.deepak15","email":"st.deepak15@gmail.com"},"directories":{},"maintainers":[{"name":"sanjeev-dailykit","email":"sanjeev@dailykit.org"},{"name":"rishisinghal92","email":"rishisinghal92@gmail.com"},{"name":"prvnbist","email":"prvnbist@gmail.com"},{"name":"st.deepak15","email":"st.deepak15@gmail.com"},{"name":"siddhantk232","email":"siddhantk232@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-escpos-helper_1.0.2_1651214414299_0.8946123138144204"},"_hasShrinkwrap":false},"1.0.3":{"name":"@dailykit/xml-escpos-helper","description":"ESC/POS with XML interface","keywords":["escpos","esc","pos","xml","printer"],"version":"1.0.3","main":"lib/index","types":"lib","engines":{"node":">=4.0.0"},"license":"Apache-2.0","scripts":{"build":"yarn  clean && yarn  compile","build:watch":"yarn compile -- -w","clean":"rm -rf ./lib && rm -rf tsconfig.build.tsbuildinfo","compile":"tsc -p ./tsconfig.build.json"},"repository":{"type":"git","url":"git+https://github.com/dailykit/xml-escpos-helper.git"},"contributors":[{"name":"Deepak Negi","email":"st.deepak15@gmail.com"}],"bugs":{"url":"https://github.com/dailykit/xml-escpos-helper/issues"},"dependencies":{"arabic-persian-reshaper":"^1.0.1","buffer":"^6.0.3","iconv-lite":"^0.6.3","mustache":"^4.1.0","mutable-buffer":"2.0.3","ndarray":"^1.0.19","pngjs":"^6.0.0","slice-ansi":"4.0.0","strip-ansi":"6.0.1","xml-parser":"^1.2.1"},"devDependencies":{"@types/node":"^14.14.20","@types/slice-ansi":"^5.0.0","@types/xml-parser":"^1.2.29","ts-loader":"^2.3.4","ts-node":"^10.7.0","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typescript":"^4.1.3"},"gitHead":"2ec3188baf1ded0a17dd3caa32acf27bbd77c2c6","homepage":"https://github.com/dailykit/xml-escpos-helper#readme","_id":"@dailykit/xml-escpos-helper@1.0.3","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Vd1UfcUDuJqEXlzYOXnpKL6VlWtZb0qzg2jE3TTDauuTdkU8lcQDHodfobsu1wQRg4mwnZ7/PSWxfm/rzA8uwQ==","shasum":"2eefaf3052a2060fedefc33429c6b0fbd3ed6547","tarball":"https://registry.npmjs.org/@dailykit/xml-escpos-helper/-/xml-escpos-helper-1.0.3.tgz","fileCount":55,"unpackedSize":79083,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEirqUGiTwas+x8DgWa6NaCeW7Yeiw/TKnbvH2dM7d+PAiBfMbLIDy+BJKD+tEF5TP/2oMi+JuJXUO8QKpqtpea62w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieK+JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq99Q//Q1iREwp34JGa0WyQeoOmhmQ9tU4zxCTB7pMPTZqyFs/Hs6ZH\r\n7e6MmYLr1NAX7llWzFkch/hABrcyIv9db3d8wi0IyG9spDqBQtP/1t9q+42z\r\nFm0RMCWw4ymZ6yeTz+KYvo11DNuJJnmzSXpVm+J9Cc7DWNBA101JRupH4rdu\r\ni8nYvZKSgz2w6dr2g0FWU35yc6BdGU5hPgfVi+NxrrEZn9iNqiwmR9s8ms9R\r\nURl/f0HRF3xge5e1AgqwsQxXXblDC17eWy8HY3pUJ5zi8+xHGmy6pWRDXoYu\r\ne6a8wVAF6js1UHl4+S5MPMTc3sRoI9uQUiNwtOYznwkvr+MfNlfIMDzYhwPd\r\nuXT9uw056VcwRjb6DIdDI8LGKcmrznKumEggdkKIujUXSaqG6ClXQadZoWr0\r\n8LQAytDa2RFKtOrwupyaAzCnehjL14jJd8vT5LXqL4l/T6uYQGsoKWTrg5XZ\r\n9/P/XMfeZJh4e9lzGGuwqsVfXOV13pwSyu+Br5RLJuH8CFb+6iOMHD5se4ls\r\nggZVSmnBFtdr1GeCEQsOu7DpPVzsQJVhh1u++D2RiOJrqpRdtUV9jC5Nhbxp\r\nHnN/b5cTnJ7rfUN+O3rfdXM1EfaQ9ZcamG5OTW9nj5k1wgtWOiancde6QiFO\r\nY/TmXuRfTWTF0flubIUhDLad/EsU2genUwg=\r\n=8nph\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"st.deepak15","email":"st.deepak15@gmail.com"},"directories":{},"maintainers":[{"name":"sanjeev-dailykit","email":"sanjeev@dailykit.org"},{"name":"rishisinghal92","email":"rishisinghal92@gmail.com"},{"name":"prvnbist","email":"prvnbist@gmail.com"},{"name":"st.deepak15","email":"st.deepak15@gmail.com"},{"name":"siddhantk232","email":"siddhantk232@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-escpos-helper_1.0.3_1652076425101_0.6621262393782197"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-27T07:23:38.206Z","1.0.0":"2022-04-27T07:23:38.458Z","modified":"2022-05-09T06:07:05.408Z","1.0.1":"2022-04-27T07:40:46.586Z","1.0.2":"2022-04-29T06:40:14.469Z","1.0.3":"2022-05-09T06:07:05.268Z"},"maintainers":[{"name":"sanjeev-dailykit","email":"sanjeev@dailykit.org"},{"name":"rishisinghal92","email":"rishisinghal92@gmail.com"},{"name":"prvnbist","email":"prvnbist@gmail.com"},{"name":"st.deepak15","email":"st.deepak15@gmail.com"},{"name":"siddhantk232","email":"siddhantk232@gmail.com"}],"description":"ESC/POS with XML interface","homepage":"https://github.com/dailykit/xml-escpos-helper#readme","keywords":["escpos","esc","pos","xml","printer"],"repository":{"type":"git","url":"git+https://github.com/dailykit/xml-escpos-helper.git"},"contributors":[{"name":"Deepak Negi","email":"st.deepak15@gmail.com"}],"bugs":{"url":"https://github.com/dailykit/xml-escpos-helper/issues"},"license":"Apache-2.0","readme":"Originally forked from [here](https://github.com/ingoncalves/escpos-xml)\r\n\r\n# ESC/POS XML\r\n\r\nCross platform JavaScript library that implements the thermal printer ESC / POS protocol and provides an XML interface for preparing templates for printing.\r\n\r\n## Features\r\n\r\n- [x] Text\r\n- [x] Text line\r\n- [x] Feed line\r\n- [x] Bold text\r\n- [x] Underline text\r\n- [x] Font size\r\n- [x] Small mode\r\n- [x] White mode\r\n- [x] Align\r\n- [x] Barcode\r\n- [x] QRcode\r\n- [x] Paper cut node\r\n- [x] Image (base64) (png only)\r\n- [x] XML with mustache\r\n\r\n## Tested manually on following environments or platforms\r\n\r\n- [x] React Native (Android)\r\n- [x] React Native (iOS)\r\n- [x] React Native Web\r\n- [x] Server side (NodeJs)\r\n- [x] Desktop applications (nwjs &amp; electron)\r\n- [x] Other node environment (terminal)\r\n\r\n## Installation\r\n\r\n```bash\r\n  yarn add @dailykit/xml-escpos-helper\r\n```\r\n\r\n## Examples\r\n\r\n### With an XML template + plain object input (regular text).\r\n\r\n```ts\r\nimport { EscPos } from '@dailykit/xml-escpos-helper';\r\n\r\n// store this template somewhere `s3` or as `static asset` based on your preference\r\nconst template = `\r\n  <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n  <document>\r\n    <align mode=\"center\">\r\n      <bold>\r\n        <text-line size=\"1:0\">{{title}}</text-line>\r\n      </bold>\r\n    </align>\r\n\r\n    {{#thankyouNote}}\r\n    <align mode=\"center\">\r\n      <text-line encoding=\"cp864\" codepage=\"22\" size=\"0:0\">  {{{thankyouNote}}}</text-line>\r\n    </align>\r\n\r\n    <line-feed />\r\n\r\n    <paper-cut />\r\n  </document>\r\n`;\r\n\r\n// if encoding & codepage in text-line is not mentioned (by default it is set to utf8 & 0 respectively)\r\n\r\nconst input = {\r\n  title: 'Sample',\r\n  thankyouNote: 'أهلا بك',\r\n};\r\n\r\nconst options = {\r\n  wrapWord: false, //true by default\r\n  wrapWordMaxLength: 48, // 32 by default\r\n};\r\n\r\nconst buffer = EscPos.getBufferFromTemplate(template, input, options);\r\n// send this buffer to a stream (eg.: bluetooth or wifi)\r\n```\r\n\r\n### With an XML template + png image (base64)\r\n\r\n```ts\r\nconst template = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n  <document>\r\n    <align mode=\"center\">\r\n      <bold>\r\n        <text-line size=\"1:0\">{{title}}</text-line>\r\n      </bold>\r\n\r\n      <image density=\"d24\">\r\n        {{base64PngImage}}\r\n      </image>\r\n    </align>\r\n  </document>`;\r\n\r\nconst input = {\r\n  title: 'PNG - base64',\r\n  base64PngImage: `data:image/png;base64,iVBORw0KGgoAAA+P/AaNn2GPEMgEFAAAAAElFTkSuQmCC`,\r\n};\r\n\r\nconst buffer = EscPos.getBufferFromTemplate(template, input);\r\n```\r\n\r\n---\r\n\r\n## TODO\r\n\r\n- [ ] Font styles (font family)\r\n- [ ] Image bitmap conversion improvements\r\n- [ ] jpeg support\r\n- [ ] Add example apps to repo\r\n- [ ] Removed uglify for some reason, need to bring it back\r\n- [ ] Improve image rendering\r\n\r\n## Common issues\r\n\r\n- If there is any delay you observe while printing with this library it is mostly due to image manipulations (try without image :mask: )\r\n\r\n## Useful links / resources\r\n\r\n- [ESC / POS Commands manual](./resources/ESCPOS_Command_Manual.pdf)\r\n- A [blog post](https://www.visuality.pl/posts/thermal-printer-protocols-for-image-and-text#:~:text=How%20can%20we%20print%20an,command%20language%20of%20thermal%20printers) explaiing about printing images with ESCPOS\r\n- Similar library for serverside - [node-escpos](https://github.com/song940/node-escpos).\r\n\r\n> Limitations on the react-native framework\r\n\r\n- [FileReader.readAsArrayBuffer](https://github.com/facebook/react-native/issues/21209) was not implemented.\r\n- Most of popular image manupulation libraries does not have support for react-native. eg : [jimp](https://www.npmjs.com/package/jimp), [jpeg-js](https://www.npmjs.com/package/jpeg-js) and [sharp](https://www.npmjs.com/package/sharp). We can use these libraries with some native node lib implemented in react native (some sort of polyfill).\r\n- For png this [library](https://github.com/photopea/UPNG.js) seems to be faster, but when tested this library with it, it is not retaining pixels at some places)\r\n- Use this [node-libs-react-native](https://www.npmjs.com/package/node-libs-react-native) if we need to use this library in react native (adds some mock or js implementation for fs, stream etc)\r\n\r\n---\r\n\r\nContributions of any kind welcome! :heart:\r\n","readmeFilename":"README.md"}