const axios = require('axios');
const options = {
headers: {
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'
}
};
const getItemId = async () => {
const res = await axios.get('https://www.supremenewyork.com/mobile_stock.json', headers = options.headers);
const data = res.data;
const products_and_categories = data['products_and_categories'];
for (let item of products_and_categories['new']) {
if (item.name.indexOf('GORE-TEX S Logo 6-Panel') != -1) {
var itemInfo = item;
}
}
return itemInfo
};
const getItemId = async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/users');
const data = await res.json();
return data;
};
console.log(getItemId().then(res => console.log(res)))