Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHow to use webtorrent in Node? #183
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi @daver182, thanks for trying out WebTorrent. What errors are you encountering in node.js? Without seeing the exact errors I can only guess at the problem. Your first example looks almost correct, except for one issue. In node you need to assign the result of var fs = require('fs');Also, it could be simplified like this: var fs = require('fs');
var WebTorrent = require('webtorrent');
var client = new WebTorrent();
client.seed('data/data1.json', function (torrent) {
console.log(torrent);
});You can see what values Your second example has many more issues. That's not how streams work. I would read the streams handbook and complete the stream-adventure nodeschool workshop to learn how to use streams correctly :) Feel free to reply if you have additional issues with WebTorrent. |
Hi, I'm trying to use webtorrent in Node but I'm getting too many errors, beside that maybe the docs arent too explanatory.
I have this:
I've tried this other way:
The errors I get are in the new Torrent call, specifically in torrent.lib line 88:
What I'm doing wrong? Is this the good aproach? The file is a JSON type, maybe thats the problem.
Thanks for any help!