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
I'm extremely newbie at Node js. When I run this the code async function search() { // Run asynchronous code const serp = require("serp");
var options = { host : "google.com", qs : { q: "seo", filter: 0, pws: 0 }, num : 100 };
const links = await serp.search(options); links.then((value) => { console.log(value); }) }
// Run the function search();`
I receive the following error
The text was updated successfully, but these errors were encountered:
@adnanhassan23, it's not a bug in the module.
Instead of:
links.then((value) => { console.log(value); })
Try:
console.log(links);
See https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html to understand Promises better, and after that checkout https://www.geeksforgeeks.org/difference-between-promise-and-async-await-in-node-js/ to see how async/await work. Basically, those keywords are syntax sugar over Promises.
Sorry, something went wrong.
No branches or pull requests
I'm extremely newbie at Node js. When I run this the code
async function search() {
// Run asynchronous code
const serp = require("serp");
var options = {
host : "google.com",
qs : {
q: "seo",
filter: 0,
pws: 0
},
num : 100
};
const links = await serp.search(options);
links.then((value) => {
console.log(value);
})
}
// Run the function
search();`
I receive the following error
The text was updated successfully, but these errors were encountered: