Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "qyu", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A general-purpose asynchronous job queue for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -13,6 +13,6 @@ # Qyu | ||
// Basic: | ||
q.add(myAsyncFunction); | ||
q(myAsyncFunction); | ||
// Extra options: | ||
q.add(myAsyncFunction, {priority: 7}, arg1, arg2 /*, ...*/)); | ||
q(myAsyncFunction, {priority: 7}, arg1, arg2 /*, ...*/)); | ||
@@ -24,3 +24,3 @@ // Doesn't matter if more jobs come around later, | ||
for (let i=0; i<10; i++) { | ||
q.add(myAsyncFunction); | ||
q(myAsyncFunction); | ||
} | ||
@@ -65,11 +65,11 @@ }, 2000); | ||
(async () => { | ||
let siteUrl = 'http://www.store-to-crawl.com/products'; | ||
let q = new Qyu({concurrency: 3}); | ||
const siteUrl = 'http://www.store-to-crawl.com/products'; | ||
const q = new Qyu({concurrency: 3}); | ||
for (let i=1; i<=10; i++) { | ||
q.add(async () => { | ||
let { data: html } = await axios(siteUrl+'?page='+i); | ||
let $ = cheerio.load(html); | ||
let products = [] | ||
$('.prod-list .product').each((i, elem) => { | ||
q(async () => { | ||
let resp = await axios(siteUrl+'?page='+i); | ||
let $ = cheerio.load(resp.data); | ||
let products = []; | ||
$('.product-list .product').each((i, elem) => { | ||
let $elem = $(elem); | ||
@@ -76,0 +76,0 @@ let title = $elem.find('.title').text(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20344