This works perfectly in terminal.
curl -H "Authorization: Bearer sknWtK4sRtd...." "https://mypropect.api.sanity.io/v2021-06-07/data/export/myDataset" > exportedData.ndjson
How can I make this work with node? This doesn't save file or return error.
const { exec } = require('child_process');
exec('curl -H "Authorization: Bearer sknWtK4sRt..." "https://myproject.api.sanity.io/v2021-06-07/data/export/mydataset" > mydataexported.ndjson');
I tried several solutions and curl libraries.
process.cwd()
location..