Permalink
Browse files

compiling and running properly(?) for nodejs-0.8.x

  • Loading branch information...
1 parent 4ba3bd2 commit 33f6b1c6ea7f51082a99e711f471fae368adec5b @heavyk heavyk committed Mar 31, 2013
Showing with 97 additions and 2 deletions.
  1. +89 −0 README.md
  2. +1 −1 binding.gyp
  3. +6 −0 examples/test.ls
  4. +1 −1 package.json
View
@@ -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(<String> config_dir_path, <Function> 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: <Integer>
+}
+```
+
+### add
+`add(<String> path, <Function> callback)`
+
+ * `path` can be a string with a magnet url, a local file, or an http link
+
+```
+callback(obj)
+{
+ errorStatus: <Integer>
+ linkType: <Integer>
+}
+```
+
+
+### list
+`list(<Function> callback)`
+
+
+### start
+`start(<Integer> TorrentId, <Function> callback)`
+```
+callback(obj)
+{
+ errorStatus: <Integer>
+}
+```
+
+### stop
+`stop(<Integer> TorrentId, <Function> callback)`
+```
+callback(obj)
+{
+ errorStatus: <Integer>
+}
+```
+
+### remove
+`remove(<Integer> TorrentId, <Boolean> delete_local_data, <Function> callback)`
+```
+callback(obj)
+{
+ errorStatus: <Integer>
+}
+```
+
+
+### mp3ToTorrent
+`mp3ToTorrent(<String> mp3_path, <Object> options, <Function> callback)`
+
+this function takes an MP3 file as an argument, with options:
+```
+options = {
+ uframeDirectory: <String>
+ torrentDirectory: <String>
+ pieceSize: <Integer>
+}
+```
+
+```
+callback(obj)
+{
+ errorStatus: <Integer>
+ orgFilePath: <String>
+ uframeHash: <String>
+ uframeFilePath: <String>
+ torrentFilePath: <String>
+ pieceSize: <Integer>
+}
+```
+
## License
(The MIT License)
View
@@ -1,7 +1,7 @@
{
"targets": [
{
- "target_name": "trans-node",
+ "target_name": "TransNode",
"sources": [
"src/transNode.cpp",
"src/bulkID3/id3_tag_frame.cpp",
View
@@ -0,0 +1,6 @@
+
+TransNode = require '../build/Release/TransNode'
+
+TransNode.open ".TransNode", (res) ->
+ console.log "TransNode started", res
+
View
@@ -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",

0 comments on commit 33f6b1c

Please sign in to comment.