sketch-exporter
v1.0.2
Published
sketch解析导出
Downloads
5
Readme
var { readSketch, canvasParse, parseSketchData, writeFile, domParse } = require("sketch-exporter")
//读取文件
readSketch("./test/aa.sketch").then((s) => {
//源数据另存为
saveDir(s, "./test/demo")
//解析第一个页面数据
var data = parseSketchData(s.pages[0]);
//导出canvas模板使用数据
var canvasData = canvasParse(data, s.images);
//将canvas数据导出成文件
writeFile(canvasData, "./test/canvas")
//dom的
var domData = domParse(data, s.images);
//导出文件
writeFile(domData, "./test/dom")
})