Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-ray/react-native-transmission
react-native module for libtransmission
https://github.com/g-ray/react-native-transmission
bittorrent react-native transmission
Last synced: 8 days ago
JSON representation
react-native module for libtransmission
- Host: GitHub
- URL: https://github.com/g-ray/react-native-transmission
- Owner: G-Ray
- License: gpl-3.0
- Created: 2023-06-08T10:11:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-28T14:16:05.000Z (4 months ago)
- Last Synced: 2024-10-22T22:22:27.679Z (21 days ago)
- Topics: bittorrent, react-native, transmission
- Language: Java
- Homepage:
- Size: 1.77 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# react-native-transmission
React native module for libtransmission.
**Only for Android for now.**
## Development
```sh
# Install vcpkg, and install required packages
vcpkg install \
curl:x86-android openssl:x86-android \
curl:x64-android openssl:x64-android \
curl:arm-android openssl:arm-android \
curl:arm64-android openssl:arm64-android
```## Installation
```sh
npm install react-native-transmission
```## Usage
```js
import Transmission from 'react-native-transmission'const tr = new Transmission(
'/data/data/com.transmissionexample/files/configDir',
'transmission'
)// Beware to correctly set the download dir when your app load,
// as default location is not correct by default on android yet.
tr.request(
{
method: 'session-set',
arguments: {
'download-dir': '/data/data/com.transmissionexample/files/downloads',
}
}, (err, res) => {}
)tr.request(
{
method: 'session-get',
arguments: {
fields: ['version'],
},
},
(err, res) => {
if (err) {
console.error(err)
}
console.log(res)
}
)// Or use tr.request as a promise
const res = await tr.request(
{
method: 'session-get',
arguments: {
fields: ['version'],
},
}
)console.log(res)
tr.close()
```## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
GPL-v3
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)