From 33f6b1c6ea7f51082a99e711f471fae368adec5b Mon Sep 17 00:00:00 2001 From: flames of love Date: Sun, 31 Mar 2013 21:23:32 +0200 Subject: [PATCH] compiling and running properly(?) for nodejs-0.8.x --- README.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ binding.gyp | 2 +- examples/test.ls | 6 ++++ package.json | 2 +- 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 examples/test.ls diff --git a/README.md b/README.md index 492036a..fb11e40 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,95 @@ TransNode node.js C++ torrent module based on libstransmission (without RPC) +this library in process of change... + * not yet compatible with node 0.10.x + * examples do not yet exist (to show off its power) + * I want to change over to (err, res) callback format + +## API + +### open +`open( config_dir_path, callback)` + + * `config_dir_path` is a path to a directory on the local disk in which all of transmission's configuration will be saved (used for reloading sessions and the like) + +``` +callback(obj) +{ + errorStatus: +} +``` + +### add +`add( path, callback)` + + * `path` can be a string with a magnet url, a local file, or an http link + +``` +callback(obj) +{ + errorStatus: + linkType: +} +``` + + +### list +`list( callback)` + + +### start +`start( TorrentId, callback)` +``` +callback(obj) +{ + errorStatus: +} +``` + +### stop +`stop( TorrentId, callback)` +``` +callback(obj) +{ + errorStatus: +} +``` + +### remove +`remove( TorrentId, delete_local_data, callback)` +``` +callback(obj) +{ + errorStatus: +} +``` + + +### mp3ToTorrent +`mp3ToTorrent( mp3_path, options, callback)` + +this function takes an MP3 file as an argument, with options: +``` +options = { + uframeDirectory: + torrentDirectory: + pieceSize: +} +``` + +``` +callback(obj) +{ + errorStatus: + orgFilePath: + uframeHash: + uframeFilePath: + torrentFilePath: + pieceSize: +} +``` + ## License (The MIT License) diff --git a/binding.gyp b/binding.gyp index dfa3e5d..a43e338 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,7 +1,7 @@ { "targets": [ { - "target_name": "trans-node", + "target_name": "TransNode", "sources": [ "src/transNode.cpp", "src/bulkID3/id3_tag_frame.cpp", diff --git a/examples/test.ls b/examples/test.ls new file mode 100644 index 0000000..37d0860 --- /dev/null +++ b/examples/test.ls @@ -0,0 +1,6 @@ + +TransNode = require '../build/Release/TransNode' + +TransNode.open ".TransNode", (res) -> + console.log "TransNode started", res + diff --git a/package.json b/package.json index 010d91f..4d14edb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "TransNode", "version": "0.1.0", - "main": "build/Release/WebWorkerThreads.node", + "main": "build/Release/TransNode.node", "description": "Lightweight Web Worker API implementation with native threads", "keywords": [ "threads",