jbrooksuk / node-summary

Node module that summarizes text using a naive summarization algorithm

Home Page:http://jbrooksuk.github.io/node-summary/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working with async/await?

JBX028 opened this issue · comments

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