Last active
October 9, 2017 18:58
-
-
Save jsmithdev/bcbc8c5c4a3c0452213b4010b242ab6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| ,converter = require('json-2-csv') | |
| ,request = require('request') | |
| //REPLACE WITH WANTED URL | |
| ,url = 'https:// [YOUR CREDS @ YOUR STORE] .myshopify.com/admin/products.json' | |
| ; | |
| request(url, (error, response, body) => { | |
| if(response.statusCode === 200){ | |
| const data = JSON.parse(body); | |
| converter.json2csv(data.products, (err, csv) => err ? console.error(err) : fs.writeFileSync('report.csv', csv)) | |
| } | |
| else { | |
| console.error(error) | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment