{"_id":"@bservan/react-native-usb-serialport-for-android","_rev":"3-a9fba74fac41006a5324d6446c58263c","name":"@bservan/react-native-usb-serialport-for-android","dist-tags":{"latest":"0.6.1"},"versions":{"0.5.0":{"name":"@bservan/react-native-usb-serialport-for-android","version":"0.5.0","keywords":["react-native","android","usb","serialport"],"author":{"url":"https://github.com/bservan","name":"bservan","email":"bservan@gmail.com"},"license":"MIT","_id":"@bservan/react-native-usb-serialport-for-android@0.5.0","maintainers":[{"name":"bservan","email":"bservangok@gmail.com"}],"homepage":"https://github.com/bservan/react-native-usb-serialport-for-android#readme","bugs":{"url":"https://github.com/bservan/react-native-usb-serialport-for-android/issues"},"dist":{"shasum":"101fff840113627129ff35ef95b4793f5f14476b","tarball":"https://registry.npmjs.org/@bservan/react-native-usb-serialport-for-android/-/react-native-usb-serialport-for-android-0.5.0.tgz","fileCount":30,"integrity":"sha512-7hKlTSfc5gxp9KBmie+Wi2K9qVkIFcdzmWJo3fbYgaFriJZjCc+p8WYffStlVvz8ZjMFpbo8Ugg8pe6sX+kCog==","signatures":[{"sig":"MEQCIEvclShzLeQuNBwFHK+KX1Bjg4hbjq8IAO+OfktV8Jz/AiBUFAZ5WdBgLRZ3CMJXp0ccyfqT7r1Y7BHTlkm9eUFSmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65711},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"639a6458f80d8ef095b98c4080ea19fd0d933edc","scripts":{"docs":"typedoc --out docs src/index.tsx","lint":"eslint \"**/*.{js,ts,tsx}\"","pods":"cd example && pod-install --quiet","test":"jest","example":"yarn --cwd example","prepare":"bob build","release":"release-it","bootstrap":"yarn example && yarn && yarn pods","typescript":"tsc --noEmit"},"_npmUser":{"name":"bservan","email":"bservangok@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/bservan/react-native-usb-serialport-for-android.git","type":"git"},"_npmVersion":"10.9.0","description":"USB serial port package for React Native. Android only.","directories":{},"_nodeVersion":"23.1.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native-community","prettier"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0.1","husky":"^6.0.0","react":"16.13.1","eslint":"^7.2.0","typedoc":"^0.22.10","prettier":"^2.0.5","commitlint":"^11.0.0","release-it":"^14.2.2","typescript":"^4.1.3","@types/jest":"^26.0.0","pod-install":"^0.1.0","@types/react":"^16.9.19","react-native":"0.63.4","@types/react-native":"0.62.13","eslint-config-prettier":"^7.0.0","eslint-plugin-prettier":"^3.1.3","react-native-builder-bob":"^0.18.0","@commitlint/config-conventional":"^11.0.0","@release-it/conventional-changelog":"^2.0.0","@react-native-community/eslint-config":"^2.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-usb-serialport-for-android_0.5.0_1740733012408_0.0460410828553135","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"0.6.0":{"name":"@bservan/react-native-usb-serialport-for-android","version":"0.6.0","keywords":["react-native","android","usb","serialport"],"author":{"url":"https://github.com/bservan","name":"bservan","email":"bservan@gmail.com"},"license":"MIT","_id":"@bservan/react-native-usb-serialport-for-android@0.6.0","maintainers":[{"name":"bservan","email":"bservangok@gmail.com"}],"homepage":"https://github.com/bservan/react-native-usb-serialport-for-android#readme","bugs":{"url":"https://github.com/bservan/react-native-usb-serialport-for-android/issues"},"dist":{"shasum":"fa35082862c93cd6ee875848bafff6ce2f822849","tarball":"https://registry.npmjs.org/@bservan/react-native-usb-serialport-for-android/-/react-native-usb-serialport-for-android-0.6.0.tgz","fileCount":50,"integrity":"sha512-uU9je1e3UhTE+1VFIw4+tJdYX6/q+R8NCBX7zglrkT46kO71ik5IUGr6oX7UKibcjYfj7bCB9I7HwpUM/8kDCA==","signatures":[{"sig":"MEUCIE6B2ROKGKANecorUb7wwVSwPoqNW1zxadDASAPEhvv9AiEAzPuGeKn+YtgGVXbI9kGtC4E1EBVDJapp28S7KEURclQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99781},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"2d45b1a30bdab87362022db4e62b0f97ccf5226e","scripts":{"docs":"typedoc --out docs src/index.tsx","lint":"eslint \"**/*.{js,ts,tsx}\"","pods":"cd example && pod-install --quiet","test":"jest","example":"yarn --cwd example","prepare":"bob build","release":"release-it","bootstrap":"yarn example && yarn && yarn pods","typescript":"tsc --noEmit"},"_npmUser":{"name":"bservan","email":"bservangok@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/bservan/react-native-usb-serialport-for-android.git","type":"git"},"_npmVersion":"10.8.1","description":"USB serial port package for React Native. Android only.","directories":{},"_nodeVersion":"20.16.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native-community","prettier"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0.1","husky":"^6.0.0","react":"16.13.1","eslint":"^7.2.0","typedoc":"^0.22.10","prettier":"^2.0.5","commitlint":"^11.0.0","release-it":"^14.2.2","typescript":"^4.1.3","@types/jest":"^26.0.0","pod-install":"^0.1.0","@types/react":"^16.9.19","react-native":"0.63.4","@types/react-native":"0.62.13","eslint-config-prettier":"^7.0.0","eslint-plugin-prettier":"^3.1.3","react-native-builder-bob":"^0.18.0","@commitlint/config-conventional":"^11.0.0","@release-it/conventional-changelog":"^2.0.0","@react-native-community/eslint-config":"^2.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-usb-serialport-for-android_0.6.0_1746477265705_0.2810078850981417","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"0.6.1":{"name":"@bservan/react-native-usb-serialport-for-android","version":"0.6.1","description":"USB serial port package for React Native. Android only.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example && pod-install --quiet","bootstrap":"yarn example && yarn && yarn pods","docs":"typedoc --out docs src/index.tsx"},"keywords":["react-native","android","usb","serialport"],"repository":{"type":"git","url":"git+https://github.com/bservan/react-native-usb-serialport-for-android.git"},"author":{"name":"bservan","email":"bservan@gmail.com","url":"https://github.com/bservan"},"license":"MIT","bugs":{"url":"https://github.com/bservan/react-native-usb-serialport-for-android/issues"},"homepage":"https://github.com/bservan/react-native-usb-serialport-for-android#readme","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^11.0.0","@react-native-community/eslint-config":"^2.0.0","@release-it/conventional-changelog":"^2.0.0","@types/jest":"^26.0.0","@types/react":"^16.9.19","@types/react-native":"0.62.13","commitlint":"^11.0.0","eslint":"^7.2.0","eslint-config-prettier":"^7.0.0","eslint-plugin-prettier":"^3.1.3","husky":"^6.0.0","jest":"^26.0.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.4","react-native-builder-bob":"^0.18.0","release-it":"^14.2.2","typedoc":"^0.22.10","typescript":"^4.1.3"},"peerDependencies":{"react":"*","react-native":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@bservan/react-native-usb-serialport-for-android@0.6.1","gitHead":"df138b403885a669ac8e0b6eb88a94ded7024552","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-et16D2o170qj9txkYyYFjQw1qAvQG6sbD1M8qPtLpdfYcJldVH15aOs7o0U9MF5sSvTs/zUXJurz772iGhKDow==","shasum":"da6c547a65573de64b67a9524aef5230fc00dd39","tarball":"https://registry.npmjs.org/@bservan/react-native-usb-serialport-for-android/-/react-native-usb-serialport-for-android-0.6.1.tgz","fileCount":28,"unpackedSize":67087,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDyIhYx4+fqnxitFpGoQPiESj9YWV1q3phBQdfGJwQ18wIgZHPs36w8c7VhrbdH2sxwvBtx7wcZwZb+S7CqTADEtI0="}]},"_npmUser":{"name":"bservan","email":"bservangok@gmail.com"},"directories":{},"maintainers":[{"name":"bservan","email":"bservangok@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-usb-serialport-for-android_0.6.1_1746478802364_0.3332631026980091"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-28T08:56:52.337Z","modified":"2025-05-05T21:00:02.785Z","0.5.0":"2025-02-28T08:56:52.637Z","0.6.0":"2025-05-05T20:34:25.939Z","0.6.1":"2025-05-05T21:00:02.614Z"},"bugs":{"url":"https://github.com/bservan/react-native-usb-serialport-for-android/issues"},"author":{"name":"bservan","email":"bservan@gmail.com","url":"https://github.com/bservan"},"license":"MIT","homepage":"https://github.com/bservan/react-native-usb-serialport-for-android#readme","keywords":["react-native","android","usb","serialport"],"repository":{"type":"git","url":"git+https://github.com/bservan/react-native-usb-serialport-for-android.git"},"description":"USB serial port package for React Native. Android only.","maintainers":[{"name":"bservan","email":"bservangok@gmail.com"}],"readme":"# @bservan/react-native-usb-serialport-for-android\n\nReact Native USB serialport module for Android platform based on [mik3y/usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android)\n\n## Installation\n\n```sh\nnpm install @bservan/react-native-usb-serialport-for-android --save\n```\n\n## Usage\n\n```js\nimport { UsbSerialManager, Parity, Codes } from \"@bservan/react-native-usb-serialport-for-android\";\n\n// ...\nconst devices = await UsbSerialManager.list();\n\ntry {\n  await UsbSerialManager.tryRequestPermission(2004);\n  const usbSerialport = await UsbSerialManager.open(2004, { baudRate: 38400, parity: Parity.None, dataBits: 8, stopBits: 1 });\n\n  const sub = usbSerialport.onReceived((event) => {\n    console.log(event.deviceId, event.data);\n  });\n  // unsubscribe\n  // sub.remove();\n\n  await usbSerialport.send('00FF');\n  \n  usbSerialport.close();\n} catch(err) {\n  console.log(err);\n  if (err.code === Codes.DEVICE_NOT_FOND) {\n    // ...\n  }\n}\n```\n\nSee [documentation](https://bastengao.com/react-native-usb-serialport-for-android/) for details.\n\n## Lifecycle-aware support\n\nStarting with 0.6.0, lifecycle-awareness is integrated into the module. By default, this feature is not enabled. To enable it, set LIFECYCLE_AWARE_USB_MODULE_ENABLED to true in your application's properties. Easiest way to do this is by adding LIFECYCLE_AWARE_USB_MODULE_ENABLED=true to gradle.properties.\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}