@sketchmine/sketch-object-id-collector
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Github banner for sketchmine

@sketchmine/sketch-object-id-collector

The Sketch object ID collector gets a Sketch (library) file and collects IDs of the following Sketch objects:

  • the file itself (the ID of the document)
  • all symbol master objects
  • all text layers

When creating a new Sketch library file, IDs must be preserved to not lose the connection to symbols and overrides in the Sketch file that uses the Sketch library file. This is why the sketch-builder uses the sketch-object-id-collector when generating a new library version of an already existing library.

Usage

Import the getObjectIdMapping function and call it with a path to a previous library build. The outFile parameter is optional. When given, the result of the collector is stored in a json-file.

import { getObjectIdMapping } from '@sketchmine/sketch-object-id-collector';

// ...

const prevBuild = '/path/to/previous/library.sketch';
const outFile = '/path/to/outfile.json';
const collection = await getObjectIdMapping(prevBuild, outFile);

Command line arguments

The object ID collector can also be executed via the command line.

-h, --help  | display help
--file      | Sketch file, previous library build
--outFile   | json file to store the collection output (optional) 

Readme

Keywords

none

Package Sidebar

Install

npm i @sketchmine/sketch-object-id-collector

Weekly Downloads

2

Version

3.0.0

License

MIT

Unpacked Size

664 kB

Total Files

13

Last publish

Collaborators

  • ddprrt
  • lukasholzer
  • tomheller