2021年4月4日星期日

How do I use this package - xd-file?

I am trying to use this package to manipulate an Adobe XD file.

Link to the package: xd-file

I need to use this code snippet in a JavaScript file. I am using Node.js.

The method I need to use is readXDFile and the code snippet displayed in the Readme is:

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

What is the Javascript equivalent for this typescript code?

Thanks!

UPDATE

Here's the JS code that I wrote now:

var xdFile = require("xd-file");    filePath = './test/Test-1/XD-Test-1.xd'  xdData = xdFile.readXDFile(filePath)  console.log(xdData)  

And here's the output:

Promise { <pending> }  

How do I get the Object as the output?

https://stackoverflow.com/questions/66942708/how-do-i-use-this-package-xd-file April 04, 2021 at 11:12PM

没有评论:

发表评论