sketch-file
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i sketch-file

Weekly Downloads

0

Version

0.3.3

License

MIT

Unpacked Size

37.5 kB

Total Files

41

Last publish

Collaborators

  • mathieudutour