Constructor
new SketchTool(params)
Constructor
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Params to be set into this instance |
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 |
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 |
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 |
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 |
Returns:
Promise
- Type
- Promise
toolOptions() → {Array}
Sketch Tool CLI options
Returns:
List of cli options
- Type
- Array