Skip to content

Conversation

@bogusfocused
Copy link

To create a promise out of crawl method we require a finish event with error.

asyncCrawl() {
        return new Promise((resolve, reject) => {
            this.crawler.on('finish', function (err) { if(!err) resolve(); else reject(err) });
            this.crawler.crawl();
        })
    }

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

Successfully merging this pull request may close these issues.

1 participant