Skip to content
Methods to make is easier to manipulate a Sketch file
JavaScript TypeScript
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
json
scripts
src
.gitignore
.npmignore
README.md
package.json
prettier.config.js
tsconfig.json handle multiple versions Nov 18, 2019

README.md

sketch-file

A Sketch file is a zip file containing a bunch of JSON files.

This package aims to make is easier to manipulate such a file.

Installation

npm install sketch-file

Usage

There are 4 different methods available:

readSketchFile

(filePath: string) => Promise<{
    document: FileFormat.Document;
    meta: FileFormat.Meta;
    user: FileFormat.User;
    pages: FileFormat.Page[];
    images: {
        [id: string]: Buffer;
    };
}>

createNewSketchFile

(version?: string) => {
    document: FileFormat.Document;
    meta: FileFormat.Meta;
    user: FileFormat.User;
    pages: FileFormat.Page[];
    images: {
        [id: string]: Buffer;
    };
}

writeSketchFile

({ document, meta, user, pages, images, }: {
    document: FileFormat.Document;
    meta: FileFormat.Meta;
    user: FileFormat.User;
    pages: FileFormat.Page[];
    images: {
        [id: string]: Buffer;
    };
}, filePath: string) => Promise<void>

generateId

;(seed?: string) => string
You can’t perform that action at this time.