Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

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

About

Methods to make is easier to manipulate a Sketch file

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.