A fetch polyfill for sketch
npm install sketch-polyfill-fetchA fetch polyfill for sketch inspired by unfetch. It is automatically included (when needed) when using skpm.
> :warning: There is no need to install it if you are using skpm!
``bash`
npm i -S sketch-polyfill-fetch
Using skpm:
`js`
export default () => {
fetch("https://google.com")
.then(response => response.text())
.then(text => console.log(text))
.catch(e => console.error(e));
};
Without skpm:
`js
const fetch = require("sketch-polyfill-fetch");
var onRun = function() {
fetch("https://google.com")
.then(response => response.text())
.then(text => console.log(text))
.catch(e => console.error(e));
};
``
> :warning: only https URLs are supported due a MacOS limitation