'use strict' import path from "path" import Piscina from "piscina" (async()=>{ const getEsearch = new Piscina({ filename: path.resolve(__dirname, './workers/esearch.js') }) // const orders = // [ // { // params: { // db: 'nuccore', // term: 'NM_001143971.2' // }, // xpath: 'string((//Id)[1])' // }, // { // params: { // db: 'gene', // term: 'NM_001143971.2' // }, // xpath: 'string((//Id)[1])' // }, // ] // const results = await Promise.all(orders.map(e => getEsearch.run(e))) // console.log(results); const orders = [ // { // params: { // db: 'nuccore', // id: '1674999401', // rettype: 'gb', // retmode: 'text' // }, // xpath: '/', // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi' // }, // { // db: 'nuccore', // id: '1674999401', // rettype: 'native', // retmode: 'xml', // endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi' // }, { db: 'pubmed', id: '19393038', retmode: 'xml', endpoint: 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi', query: `**.AbstractText` }, ] const results = await Promise.all(orders.map(e => getEsearch.run(e))) console.log(results); })()