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

0.1.2 • Public • Published

xd-file

An Adobe XD file is a zip file containing a bunch of JSON/XML/plain text files.

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

Installation

npm install xd-file

Usage

There are 4 different methods available:

readXDFile

(filePath: string) => Promise<{
  document: Object,
  interactions: Object,
  metadata: Object,
  resources: Object,
  artboards: Array<Object>,
}>

createNewXDFile

(documentId?: string, artboards?: Array<{
  id: string
  name?: string
  layers?: Object[]
  width: number
  height: number
  x: number
  y: number
  viewportHeigh: number
}>) => Promise<{
  document: Object,
  interactions: Object,
  metadata: Object,
  resources: Object,
  artboards: Array<Object>,
}>

writeXDFile

(xdFile: {
  document: Object,
  interactions: Object,
  metadata: Object,
  resources: Object,
  artboards: Array<Object>,
}, filePath: string) => Promise<void>

generateId

;(seed?: string) => string

Readme

Keywords

none

Package Sidebar

Install

npm i xd-file

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

73.1 kB

Total Files

14

Last publish

Collaborators

  • mathieudutour