artboards-to-buffer
v1.5.0
Published
Parse artboards inside any sketch file and get buffer data
Downloads
2
Maintainers
Readme
artboards-to-buffer
Parse artboards inside any sketch file and get buffer data
Installation
npm install artboards-to-buffer
Usage
How to import
import { Sketch, Exporter } from 'artboards-to-buffer';
To get metadata of a sketch file
new Sketch({file: sketchFile})
.asExport({ outputPath })
.getMetaData( new Exporter({ bin: sketchToolBin }) )
.then(console.log)
.catch(console.log);
To export an artboard and get buffer data
new Sketch({file: sketchFile})
.asExport({ outputPath })
.getArtboardData( new Exporter({ bin: sketchToolBin }), '4535252D-1C8C-4B56-85D8-4E36D7B00D37' )
.then(console.log)
.catch(console.log);
You can use the wrapper below to send arguments to sketchtool (you must include a binary path to your sketchtool)
new Exporter({ bin: sketchToolBin })
.run([args]);