Skip to content

Commit

Permalink
compiling and running properly(?) for nodejs-0.8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyk committed Mar 31, 2013
1 parent 4ba3bd2 commit 33f6b1c
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 2 deletions.
89 changes: 89 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
@@ -1,7 +1,7 @@
{
"targets": [
{
"target_name": "trans-node",
"target_name": "TransNode",
"sources": [
"src/transNode.cpp",
"src/bulkID3/id3_tag_frame.cpp",
Expand Down
6 changes: 6 additions & 0 deletions examples/test.ls
@@ -0,0 +1,6 @@

TransNode = require '../build/Release/TransNode'

TransNode.open ".TransNode", (res) ->
console.log "TransNode started", res

2 changes: 1 addition & 1 deletion 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",
Expand Down

0 comments on commit 33f6b1c

Please sign in to comment.