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

Not working with async/await? #45

Open
JBX028 opened this issue Mar 19, 2020 · 0 comments
Open

Not working with async/await? #45

JBX028 opened this issue Mar 19, 2020 · 0 comments

Comments

@JBX028
Copy link

JBX028 commented Mar 19, 2020

Hi,

Can we used this function with async/await? The following code doesn't work for me and I am not able to figure out why because the same approach works with other packages:

const SummaryTool = require('node-summary');

const getTextFromHTML = async (url) => {
    return await SummaryTool.summarizeFromUrl(url);
}

const start = async () => {
  const source = await getTextFromHTML("https://en.wikipedia.org/wiki/Google");
  console.log(source);
}

start()

Thanks

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

No branches or pull requests

1 participant