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.
npm install xd-file
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