1.0.1 • Published 5 years ago

sketch-image-downloader v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

sketch-image-downloader

A Sketch module to handle image downloads and insertion in documents

Usage

insertImage(url, parentLayer)

Inserts a bitmap layer in parentLayer with the contents of the image at url. Returns the image layer as a Promise, so you can chain the function.

import sketch from 'sketch'
import insertImage from 'sketch-image-downloader'

insertImage('https://source.unsplash.com/random', sketch.getSelectedDocument().selectedPage)

With promises:

import sketch from 'sketch'
import insertImage from 'sketch-image-downloader'

insertImage('https://source.unsplash.com/random', sketch.getSelectedDocument().selectedPage).then(layer => {
  console.log(`Inserted layer: ${layer.name}`)
})
1.0.1

5 years ago

1.0.0

5 years ago