We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, great project! Just leaving this here in case someone else wants to rewrite the example code with async / await.
const { promisify } = require('util'); const slsk = require('slsk-client'); const connect = promisify(slsk.connect); const main = async () => { try { const client = await connect({ user: 'your_username', pass: 'your_password' }); const search = promisify(client.search); const download = promisify(client.download); console.log("searching..."); const searchResults = await search.call(client, ({ req: 'random', timeout: 2000 })); console.log("search done!") console.log("downloading: ", searchResults[0]); await download({ file: searchResults[0], path: __dirname + '/random.mp3'}); console.log("download done!"); } catch (err) { console.log(err); } } main();
The text was updated successfully, but these errors were encountered:
Oh my gosh, thank you so much! I almost thought this couldn't be done.
Sorry, something went wrong.
tks for sharing
No branches or pull requests
Hi,
great project! Just leaving this here in case someone else wants to rewrite the example code with async / await.
The text was updated successfully, but these errors were encountered: