oscarotero / node-sketch

💎 Javascript library to manipulate sketch files
https://oscarotero.github.io/node-sketch/
MIT License
304 stars 23 forks source link

sketch.getAll is not a function #19

Closed pod4g closed 5 years ago

pod4g commented 5 years ago
node -v 
v8.12.0

node-sketch
v0.14.1

(node:15887) UnhandledPromiseRejectionWarning: TypeError: sketch.getAll is not a function at run (/Users/rihikobon/study/demo/index.js:11:10) at (node:15887) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:15887) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

oscarotero commented 5 years ago

Yep, sorry, you're right. The example in README is wrong. getAll is in all Node instances, not Skech. You could do something like the following:

const page = sketch.pages[0]; //get the first page

//Page is a Node, so it has getAll
page.getAll('symbolInstance').forEach(...)
aarifsolankey commented 4 years ago

dsdfdsasfsad###