{"_id":"@bluub1t/react-native-thermal-receipt-printer","_rev":"3-b97a9140fa20a3ef4b4ae4c3e2713c9b","name":"@bluub1t/react-native-thermal-receipt-printer","dist-tags":{"latest":"1.6.0"},"versions":{"1.4.0":{"name":"@bluub1t/react-native-thermal-receipt-printer","version":"1.4.0","keywords":["react-native","thermal","printer","bluetooth","net","printer","rn","android"],"author":{"name":"bluu"},"license":"ISC","_id":"@bluub1t/react-native-thermal-receipt-printer@1.4.0","maintainers":[{"name":"bluub1t","email":"bluubits@gmail.com"}],"homepage":"https://github.com/Bluu/react-native-thermal-receipt-printer","bugs":{"url":"https://github.com/Bluu/react-native-thermal-receipt-printer/issues"},"dist":{"shasum":"3660f47942790f29e72288381367699bd45c9b25","tarball":"https://registry.npmjs.org/@bluub1t/react-native-thermal-receipt-printer/-/react-native-thermal-receipt-printer-1.4.0.tgz","fileCount":49,"integrity":"sha512-smiEcdhq6VQcHkvp2OwLJyOcE6bPRKb81tuqRQeQPOi0nGX+4CrUc3avf1iOghWxgDuXsE5sExn7LwyVfHTL6Q==","signatures":[{"sig":"MEUCIDPVe+b/OvhdG2/LpHGDutQEhqyWAXzWlNtBKd4HoIiXAiEA6qgkZV3cpRT3RLgK6xqxa3hYuRoKgOVh0TVUE4XfKpc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6259267},"main":"dist/index.js","types":"./dist/index.d.ts","source":"dist/index.js","gitHead":"a4243f9f1f30b5b47e0025f4245a8c2eff74a11f","scripts":{"pods":"cd example && pod-install --quiet","build":"rimraf ./dist && tsc","example":"yarn --cwd example","bootstrap":"yarn example && yarn && yarn pods"},"_npmUser":{"name":"bluub1t","email":"bluubits@gmail.com"},"repository":{"url":"git+https://github.com/Bluu/react-native-thermal-receipt-printer.git","type":"git"},"_npmVersion":"11.6.2","description":"Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer","directories":{},"_nodeVersion":"25.1.0","dependencies":{"buffer":"^5.6.0","iconv-lite":"^0.6.2","string_decoder":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"react":"^16.13.1","rimraf":"^3.0.2","typescript":"^4.0.2","@types/jest":"^26.0.10","@types/node":"^14.6.0","pod-install":"^0.1.10","@types/react":"^16.9.46","react-native":"^0.64.1","@types/react-native":"^0.63.9","@types/react-test-renderer":"^16.9.3"},"_npmOperationalInternal":{"tmp":"tmp/react-native-thermal-receipt-printer_1.4.0_1775206128197_0.6931628937544669","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@bluub1t/react-native-thermal-receipt-printer","version":"1.5.0","keywords":["react-native","thermal","printer","bluetooth","net","printer","rn","android"],"author":{"name":"bluu"},"license":"ISC","_id":"@bluub1t/react-native-thermal-receipt-printer@1.5.0","maintainers":[{"name":"bluub1t","email":"bluubits@gmail.com"}],"homepage":"https://github.com/Bluu/react-native-thermal-receipt-printer","bugs":{"url":"https://github.com/Bluu/react-native-thermal-receipt-printer/issues"},"dist":{"shasum":"fd34425617774efd060b49d7f12adee775843881","tarball":"https://registry.npmjs.org/@bluub1t/react-native-thermal-receipt-printer/-/react-native-thermal-receipt-printer-1.5.0.tgz","fileCount":48,"integrity":"sha512-u6lzflB4wzru73NzDgfyMLmBcisaXL3u0c9zLnNwASgGRYx9K2KAA095xVZev+IeUrfMDdfmszxaal7rbSPxBw==","signatures":[{"sig":"MEUCIQCvjxoUCQOePOZGWXeE9wzijlc9A2jGfbq4s2q5p3OT2QIgToowaNZ5eIouerz9u6bNIIZ83wyduO2QHQQUd9P6tAE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6258397},"main":"dist/index.js","types":"./dist/index.d.ts","source":"dist/index.js","gitHead":"b1fbac9b5a3366765c53f46b06a3a946d5ca9529","scripts":{"pods":"cd example && pod-install --quiet","build":"rimraf ./dist && tsc","example":"yarn --cwd example","bootstrap":"yarn example && yarn && yarn pods"},"_npmUser":{"name":"bluub1t","email":"bluubits@gmail.com"},"repository":{"url":"git+https://github.com/Bluu/react-native-thermal-receipt-printer.git","type":"git"},"_npmVersion":"11.6.2","description":"Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer","directories":{},"_nodeVersion":"25.1.0","dependencies":{"buffer":"^5.6.0","iconv-lite":"^0.6.2","string_decoder":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"react":"^16.13.1","rimraf":"^3.0.2","typescript":"^4.0.2","@types/jest":"^26.0.10","@types/node":"^14.6.0","pod-install":"^0.1.10","@types/react":"^16.9.46","react-native":"^0.64.1","@types/react-native":"^0.63.9","@types/react-test-renderer":"^16.9.3"},"_npmOperationalInternal":{"tmp":"tmp/react-native-thermal-receipt-printer_1.5.0_1775460352289_0.8306626582115466","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"@bluub1t/react-native-thermal-receipt-printer","version":"1.6.0","description":"Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer","main":"dist/index.js","source":"dist/index.js","scripts":{"pods":"cd example && pod-install --quiet","example":"yarn --cwd example","bootstrap":"yarn example && yarn && yarn pods","build":"rimraf ./dist && tsc"},"repository":{"type":"git","url":"git+https://github.com/Bluu/react-native-thermal-receipt-printer.git"},"keywords":["react-native","thermal","printer","bluetooth","net","printer","rn","android"],"dependencies":{"buffer":"^5.6.0","iconv-lite":"^0.6.2","string_decoder":"^1.3.0"},"devDependencies":{"@types/jest":"^26.0.10","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-native":"^0.63.9","@types/react-test-renderer":"^16.9.3","pod-install":"^0.1.10","react":"^16.13.1","react-native":"^0.64.1","rimraf":"^3.0.2","typescript":"^4.0.2"},"author":{"name":"bluu"},"homepage":"https://github.com/Bluu/react-native-thermal-receipt-printer","license":"ISC","gitHead":"eeb11ccc460564c3f326a9c93eec498897094d1d","types":"./dist/index.d.ts","_id":"@bluub1t/react-native-thermal-receipt-printer@1.6.0","bugs":{"url":"https://github.com/Bluu/react-native-thermal-receipt-printer/issues"},"_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-0snJ1LL3gHW/ow7TjpbbYYR23Keum4WSemRB1o9JoEGQSJUbzQy/i8uZsgifnZIBdvkxO4/5Ke+x3PY4GS9NCQ==","shasum":"56b62554960837672c15a519baf7e788ebed980f","tarball":"https://registry.npmjs.org/@bluub1t/react-native-thermal-receipt-printer/-/react-native-thermal-receipt-printer-1.6.0.tgz","fileCount":48,"unpackedSize":6258803,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIESdoIO5Wr2Fb8S4S+vUho84IkgyyFNB/wOySAAwsctMAiEAmDPLmjjRRYYZVmcUM4uYMvSMb2RdhijmNcOB5xGF6pQ="}]},"_npmUser":{"name":"bluub1t","email":"bluubits@gmail.com"},"directories":{},"maintainers":[{"name":"bluub1t","email":"bluubits@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-thermal-receipt-printer_1.6.0_1775466418694_0.08454100327810465"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-03T08:48:48.058Z","modified":"2026-04-06T09:06:59.059Z","1.4.0":"2026-04-03T08:48:48.417Z","1.5.0":"2026-04-06T07:25:52.512Z","1.6.0":"2026-04-06T09:06:58.896Z"},"bugs":{"url":"https://github.com/Bluu/react-native-thermal-receipt-printer/issues"},"author":{"name":"bluu"},"license":"ISC","homepage":"https://github.com/Bluu/react-native-thermal-receipt-printer","keywords":["react-native","thermal","printer","bluetooth","net","printer","rn","android"],"repository":{"type":"git","url":"git+https://github.com/Bluu/react-native-thermal-receipt-printer.git"},"description":"Fork of react-native-printer. A React Native Library to support USB/BLE/Net printer","maintainers":[{"name":"bluub1t","email":"bluubits@gmail.com"}],"readme":"# react-native-thermal-receipt-printer\n\nFork of `react-native-printer` and add implement for auto connect printer with usb\nA React Native Library to support USB/BLE/Net printer\n\n![Node.js Package](https://github.com/HeligPfleigh/react-native-thermal-receipt-printer/workflows/Node.js%20Package/badge.svg)\n\n## Installation\n\n```\nyarn add react-native-thermal-receipt-printer\n```\n\n## Troubleshoot\n\n- when install in `react-native` version >= 0.60, xcode show this error\n\n```\nduplicate symbols for architecture x86_64\n```\n\nthat because the .a library uses [CocoaAsyncSocket](https://github.com/robbiehanson/CocoaAsyncSocket) library and Flipper uses it too\n\n_Podfile_\n\n```diff\n...\n  use_native_modules!\n\n  # Enables Flipper.\n  #\n  # Note that if you have use_frameworks! enabled, Flipper will not work and\n  # you should disable these next few lines.\n  # add_flipper_pods!\n  # post_install do |installer|\n  #   flipper_post_install(installer)\n  # end\n...\n```\n\nand comment out code related to Flipper in `ios/AppDelegate.m`\n\n## Support\n\n| Printer    | Android            | IOS                |\n| ---------- | ------------------ | ------------------ |\n| USBPrinter | :heavy_check_mark: |                    |\n| BLEPrinter | :heavy_check_mark: | :heavy_check_mark: |\n| NetPrinter | :heavy_check_mark: | :heavy_check_mark: |\n\n## Predefined tag\n| Tags          | Description           |\n|:-------------:|:---------------------:|\n| C             | Center                |\n| D             | Medium font           |\n| B             | Large font            |\n| M             | Medium font           |\n| CM            | Medium font, centered |\n| CB            | Medium font, centered |\n| CD            | Large font, centered  |\n\n## Development workflow\n\nTo get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:\n\n```sh\nyarn bootstrap\n```\n\nWhile developing, you can run the [example app](/example/) to test your changes.\n\nTo start the packager:\n\n```sh\nyarn example start\n```\n\nTo run the example app on Android:\n\n```sh\nyarn example dev-android\n```\n\nTo run the example app on iOS:\n\n```sh\nyarn example ios\n```\n\n## Usage\n\n```javascript\nimport {\n  USBPrinter,\n  NetPrinter,\n  BLEPrinter,\n} from \"react-native-thermal-receipt-printer\";\n\nUSBPrinter.printText(\"<C>sample text</C>\");\nUSBPrinter.printBill(\"<C>sample bill</C>\");\n```\n\n## Example\n\n### USBPrinter (only support android)\n\n```typescript\ninterface IUSBPrinter {\n  device_name: string;\n  vendor_id: number;\n  product_id: number;\n}\n```\n\n```javascript\n  const [printers, setPrinters] = useState([]);\n  const [currentPrinter, setCurrentPrinter] = useState();\n\n  useEffect = () => {\n    if(Platform.OS == 'android'){\n      USBPrinter.init().then(()=> {\n        //list printers\n        USBPrinter.getDeviceList().then(setPrinters);\n      })\n    }\n  }\n\n  const _connectPrinter = (printer) => USBPrinter.connectPrinter(printer.vendorID, printer.productId).then(() => setCurrentPrinter(printer))\n\n  const printTextTest = () => {\n    currentPrinter && USBPrinter.printText(\"<C>sample text</C>\\n\");\n  }\n\n  const printBillTest = () => {\n    currentPrinter && USBPrinter.printBill(\"<C>sample bill</C>\");\n  }\n\n  ...\n\n  return (\n    <View style={styles.container}>\n      {\n        printers.map(printer => (\n          <TouchableOpacity key={printer.device_id} onPress={() => _connectPrinter(printer)}>\n            {`device_name: ${printer.device_name}, device_id: ${printer.device_id}, vendor_id: ${printer.vendor_id}, product_id: ${printer.product_id}`}\n          </TouchableOpacity>\n          ))\n      }\n      <TouchableOpacity onPress={printTextTest}>\n        <Text>Print Text</Text>\n      </TouchableOpacity>\n      <TouchableOpacity onPress={printBillTest}>\n        <Text>Print Bill Text</Text>\n      </TouchableOpacity>\n    </View>\n  )\n\n  ...\n\n```\n\n### BLEPrinter\n\n```typescript\ninterface IBLEPrinter {\n  device_name: string;\n  inner_mac_address: string;\n}\n```\n\n```javascript\n  const [printers, setPrinters] = useState([]);\n  const [currentPrinter, setCurrentPrinter] = useState();\n\n  useEffect(() => {\n    BLEPrinter.init().then(()=> {\n      BLEPrinter.getDeviceList().then(setPrinters);\n    });\n  }, []);\n\n  _connectPrinter => (printer) => {\n    //connect printer\n    BLEPrinter.connectPrinter(printer.inner_mac_address).then(\n      setCurrentPrinter,\n      error => console.warn(error))\n  }\n\n  printTextTest = () => {\n    currentPrinter && BLEPrinter.printText(\"<C>sample text</C>\\n\");\n  }\n\n  printBillTest = () => {\n    currentPrinter && BLEPrinter.printBill(\"<C>sample bill</C>\");\n  }\n\n  ...\n\n  return (\n    <View style={styles.container}>\n      {\n        this.state.printers.map(printer => (\n          <TouchableOpacity key={printer.inner_mac_address} onPress={() => _connectPrinter(printer)}>\n            {`device_name: ${printer.device_name}, inner_mac_address: ${printer.inner_mac_address}`}\n          </TouchableOpacity>\n          ))\n      }\n      <TouchableOpacity onPress={printTextTest}>\n        <Text>Print Text</Text>\n      </TouchableOpacity>\n      <TouchableOpacity onPress={printBillTest}>\n        <Text>Print Bill Text</Text>\n      </TouchableOpacity>\n    </View>\n  )\n\n  ...\n\n```\n\n### NetPrinter\n\n```typescript\ninterface INetPrinter {\n  device_name: string;\n  host: string;\n  port: number;\n}\n```\n\n_Note:_ get list device for net printers is support scanning in local ip but not recommended\n\n```javascript\n\n  componentDidMount = () => {\n    NetPrinter.init().then(() => {\n      this.setState(Object.assign({}, this.state, {printers: [{host: '192.168.10.241', port: 9100}]}))\n      })\n  }\n\n  _connectPrinter => (host, port) => {\n    //connect printer\n    NetPrinter.connectPrinter(host, port).then(\n      (printer) => this.setState(Object.assign({}, this.state, {currentPrinter: printer})),\n      error => console.warn(error))\n}\n\n  printTextTest = () => {\n    if (this.state.currentPrinter) {\n      NetPrinter.printText(\"<C>sample text</C>\\n\");\n    }\n  }\n\n  printBillTest = () => {\n    if(this.state.currentPrinter) {\n      NetPrinter.printBill(\"<C>sample bill</C>\");\n    }\n  }\n\n  ...\n\n  render() {\n    return (\n      <View style={styles.container}>\n        {\n          this.state.printers.map(printer => (\n            <TouchableOpacity key={printer.device_id} onPress={(printer) => this._connectPrinter(printer.host, printer.port)}>\n              {`device_name: ${printer.device_name}, host: ${printer.host}, port: ${printer.port}`}\n            </TouchableOpacity>\n            ))\n        }\n        <TouchableOpacity onPress={() => this.printTextTest()}>\n          <Text> Print Text </Text>\n        </TouchableOpacity>\n        <TouchableOpacity onPress={() => this.printBillTest()}>\n          <Text> Print Bill Text </Text>\n        </TouchableOpacity>\n      </View>\n    )\n  }\n\n  ...\n\n```\n","readmeFilename":"README.md"}