Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

transmission-native

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transmission-native

transmission-native

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

transmission-native

Native bindings for libtransmission.

JavaScript Style Guide

Installation

The package is not yet published to npm. Please refer to development.

Usage

const Transmission = require('transmission-native')

// Create a transmission instance with config folder and app name
const tr = new Transmission('./transmission', 'transmission')

const response = await tr.request({ method: 'session-get' })


// Add a new torrent
const message = {
    method: 'torrent-add',
    arguments: {
        filename: 'https://webtorrent.io/torrents/tears-of-steel.torrent'
    }
}

const reponse = await tr.request(messages)
console.log(response)

// Later, when the process should be stopped, close the instance before
tr.close()

Please refer to transmission's rpc-spec.md to find what methods and arguments are expected.

API

tr = new Transmission(configDir, appName)

Create a transmission instance with a specific configuration folder and application name.
configDir is the path where settings and state of the transmission process will be loaded and stored.

tr.request(message)

Make a request to the transmission instance. message is an object expected by transmissions's rpc-spec.md.

const message = { method: 'session-get' }

const reponse = await tr.request(messages)
console.log(response)

// or as a callback
tr.request(message, (err, response) => {
  if (err) throw err
  console.log(response)
})

Development

You'll need to install required build tools and libraries for your platform in order to compile libtransmission.

npm run fetch-deps
npm run build-transmission
npm install
npm test # optional

License

GPL-3.0

FAQs

Package last updated on 01 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc