Browser Devtool console is Figma's best scripting tool, FigmaConsoleKit can make it better, add a debugging-friendly API, most commonly used libraries(axios,lodash,mathjs,Color,font-color-contrast).
paste code into figma console
fetch(
"https://raw.githubusercontent.com/Moonvy/FigmaConsoleKit/master/dist/FigmaConsoleKit.js?v1.1.0"
).then((r) => r.text().then((c) => eval(c)));or
paste the code into console
- ๐ฅ
activeNodescurrently selected layers (multiple) - ๐ฅ
activeNodecurrently selected layer (only one is fetched) getChildrenByName(node)get multiple sublayers by layer namegetClidByName(node)get a sublayer by layer name
show(node)Show layer informationjson(node)converts the layer information into a JSON string
toFloatColor(intColor)[255,255,255] => {r:1.0, g:1.0, b:1.0}toIntColor(floatColor){r:1.0, g:1.0, b:1.0} => [255,255,255]
loadNodeFonts(node)prepare the font used for a layersetNodeText(node, text)set the text content of the text layer
tidyX(nodes, cols, gap)rearrange layers by number of columns
axiosbest JavaScript HTTP client.font-color-contrastuse black or white font according to the given background color.lodasha modern JavaScript utility library delivering modularity, performance & extras.mathjsan extensive math library.Colorimmutable color conversion and manipulation with support for CSS color strings.

