UNPKG

scrapper-tools

Version:

Its in development but I use it in all my web automation project.

13 lines (11 loc) 293 B
import AsyncLock from 'async-lock' let lock = new AsyncLock() import { Parser } from 'json2csv' export default async (fields, jsObjects) => { return await lock.acquire('jsonToCSV', async () => { const parser = new Parser({ fields, }) return parser.parse(jsObjects) }) }