Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createTorrent() sample code does not trigger callback function #93

Closed
laksh1010 opened this issue Mar 29, 2019 · 8 comments
Closed

createTorrent() sample code does not trigger callback function #93

laksh1010 opened this issue Mar 29, 2019 · 8 comments
Labels

Comments

@laksh1010
Copy link

laksh1010 commented Mar 29, 2019

i tried the simple code mentioend but seems the function (err, torrent) does not give any reponse at all. even an error if something is wrong. my os is win 10. and i created /path/to/folder in project folder and also created a sample test.txt at the end too.

var createTorrent = require('create-torrent')
var fs = require('fs')

        createTorrent('/path/to/folder', function (err, torrent) {

            console.log("SHOULD LOG HERE ANYWAY"); // no luck here at all
            
            if (!err) {
              // `torrent` is a Buffer with the contents of the new .torrent file
              fs.writeFile('my.torrent', torrent)
            }
          })
@uxes
Copy link

uxes commented Apr 17, 2019

you’ll have to use writeFileSync

    // `torrent` is a Buffer with the contents of the new .torrent file
    fs.writeFileSync('my.torrent', torrent)
  }
})

@laksh1010
Copy link
Author

you’ll have to use writeFileSync

    // `torrent` is a Buffer with the contents of the new .torrent file
    fs.writeFileSync('my.torrent', torrent)
  }
})

I already tried it mate. the problem is even that console log before that would not trigger

console.log("SHOULD LOG HERE ANYWAY"); // no luck here at all

i mean the whatever in call back function , does not trigger.

Do you have any working code mate. kindly let me know if you have.

I am stuck here for days and could not find any torrent creating solution in node either :(

@lijy1992
Copy link

hi
Can you tell me the solution?

@uxes

This comment has been minimized.

@feross
Copy link
Member

feross commented Sep 10, 2019

@laksh1010 Did you update /path/to/torrent to be the actual path that your files exist at? It would be very helpful if you could share a .zip file with the code you wrote and files you are trying to create a torrent for so we can reproduce the issue.

@feross

This comment has been minimized.

@uxes

This comment has been minimized.

@github-actions
Copy link

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants