0.3.3 • Published 12 months ago

react-native-transmission v0.3.3

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
12 months ago

react-native-transmission

React native module for libtransmission.

Only for Android for now.

Installation

npm install react-native-transmission

Usage

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 to learn how to contribute to the repository and the development workflow.

License

GPL-v3


Made with create-react-native-library

0.3.2

12 months ago

0.3.3

12 months ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago