How to get output of this code in browser? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

How to get output of this code in browser?

I want this script to run on browser - https://github.com/JimmyLaurent/torrent-search-api There is a quick example given in read.me file in which a variable 'torrents' will be having all output. I am able to get the output somehow in command prompt. But I want the results to be in browser's console log or anywhere on browser. Anyone who can help?

6th Jul 2019, 7:23 AM
Sachin Artani
Sachin Artani - avatar
10 Answers
+ 10
Hey Sachin Artani Got a code snippet to examine? the await operator is part of JS and not of the react library
6th Jul 2019, 9:01 AM
Burey
Burey - avatar
+ 7
That's a node package i guess, not mean for front end react
6th Jul 2019, 9:54 AM
Calviղ
Calviղ - avatar
+ 3
I dont understand relation between await operator (than is a js operator https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await ) and the link that you posted which is a nodejs package and like Calviղ suggested is for backend programming (eg. its not mean to be runned in your browser)
6th Jul 2019, 10:03 AM
KrOW
KrOW - avatar
+ 2
Burey If you open the readme of that repository, you will see Quick Example with 3 lines of code. That's what I want to run and get the JSON output in 'torrents' variable. I am able to get it via node, using command- node filename.js but I want output in browser.
7th Jul 2019, 4:44 AM
Sachin Artani
Sachin Artani - avatar
+ 2
Calviղ KrOW I literally have no idea, but this work is important for me. By seeing .js file everywhere I assumed it as react js made script. If you can understand how that quick example piece of code could work, please let me know.
7th Jul 2019, 4:45 AM
Sachin Artani
Sachin Artani - avatar
+ 2
I'm changing the question as it does not seems to be a reactjs question!
7th Jul 2019, 3:39 PM
Sachin Artani
Sachin Artani - avatar
+ 2
Coder So many. Will discuss it someday, I am engaged into different projects nowadays! Kept it aside. 😅
11th Aug 2019, 7:39 AM
Sachin Artani
Sachin Artani - avatar
+ 1
You can write the node.js on glitch.com
7th Jul 2019, 11:32 PM
Calviղ
Calviղ - avatar
+ 1
Coder I tried, but got errors. 😅
10th Aug 2019, 5:17 PM
Sachin Artani
Sachin Artani - avatar