SketchTool

SketchTool

SketchTool Class

Constructor

new SketchTool(params)

Constructor
Parameters:
Name Type Description
params Object Params to be set into this instance
Source:

Methods

exportCall(type, params) → {Promise}

Call the exports function with subcommands using `type`
Parameters:
Name Type Description
type String Subcommand to be run, eg: artboards, layers, etc.
params Object Parameters to be sent with this subcommand
Source:
Returns:
Promise
Type
Promise

getArgs(params) → {Array}

Get a list of valid options in the format spawn needs
Parameters:
Name Type Description
params Object Key values of the options we want to pass to sketchtool
Source:
Returns:
Array of options formatted in spawns format
Type
Array

listCall(type, params) → {Promise}

Call the list function with subcommand using `type`
Parameters:
Name Type Description
type String Subcommand to be run, eg: artboards, formats, etc.
params Object Parameters to be sent with this command
Source:
Returns:
Promise
Type
Promise

runCommand(command, args) → {Promise}

Spawn a child process of sketch-tool and run a given command with parameters
Parameters:
Name Type Description
command String Command to be run
args Array Command arguments to be sent with the command
Source:
Returns:
Promise
Type
Promise

toolOptions() → {Array}

Sketch Tool CLI options
Source:
Returns:
List of cli options
Type
Array