zethussuen / gulp-sketch

A SketchTool plugin for gulp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-sketch Build Status

A SketchTool plugin for gulp.

Install

Download SketchTool and install it to your environment.

npm install gulp-sketch --save-dev

Usage

var gulp = require("gulp");
var sketch = require("gulp-sketch");

gulp.task('sketch', function(){
  return gulp.src("./src/sketch/*.sketch")
    .pipe(sketch({
      export: 'slices',
      formats: 'png'
    }))
    .pipe(gulp.dest("./dist/images/"));
});

or write it in CoffeeScript.

gulp = require 'gulp'
sketch = require 'gulp-sketch'

gulp.task 'sketch', ->
  gulp.src './src/sketch/*.sketch'
  .pipe sketch
    export: 'slices'
    formats: 'png'
  .pipe gulp.dest './dist/images/'

Options

The options are the same as what's supported by SketchTool.

  • export: pages,artboards,slices
  • formats: png,jpg,pdf,eps,svg
  • scales: 1.0,2.0
  • items: List of artboard/slice names or ids to export. The default is to export all artboards/slices (optional).
  • bounds:
  • saveForWeb: Export web-ready images (optional, defaults to NO).
  • compact: Export in compact form. Currently only relevant for SVG export. (optional, defaults to NO).
  • trimmed: Export images trimmed. (optional, defaults to NO).

About

A SketchTool plugin for gulp

License:MIT License


Languages

Language:CoffeeScript 100.0%