Skip to content

zhzxang/sketch-fetch-complete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sketch-fetch-complete(fork by skpm/sketch-polyfill-fetch)

A fetch polyfill for sketch inspired by unfetch. It is automatically included (when needed) when using skpm.

Installation

npm i -S sketch-fetch-complete

Usage

const fetch = require('sketch-fetch-complete')

fetch("https://google.com")
  .then(response => response.text())
  .then(text => console.log(text))
  .catch(e => console.error(e))

extra add

upload file

const fetch = require('sketch-fetch-complete')

fetch("https://google.com", {
  method: 'post',
  formdata: {
    files: [path],
    ...objects,
  }
})
  .then(response => response.json())
  .then(text => console.log(text))
  .catch(e => console.error(e))

About

A fetch polyfill for sketch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%