Saturday, 27 May 2017

Nodejs not writing the files

I am new to nodejs. When i tried to run the below code, it not giving me the correct out put. according to me the below program will generate a 'tmp.torrent' file . But it is not happening.

    var Torrent = require('webseeded-torrent-generator');
    var fs = require('fs');
    var base = 'http://ia700201.us.archive.org/6/items/';
    var name = 'jj2005-02-27.fm.shnf';
    var files = [
        'jj2005-02-27.fm.d1.md5',
        'jj2005-02-27.fm.d1.txt'
    ];

    var torrent = new Torrent(base, name, files);
    torrent.getMetadata().then(function (buf) {
        fs.writeFileSync('tmp.torrent', buf);
    });



via Svd Ks

No comments:

Post a Comment