{"id":18248356,"url":"https://github.com/moonvy/figmaconsolekit","last_synced_at":"2025-04-04T15:32:24.179Z","repository":{"id":49420922,"uuid":"376504369","full_name":"Moonvy/FigmaConsoleKit","owner":"Moonvy","description":"🏂  Enhanced Figma console. ","archived":false,"fork":false,"pushed_at":"2022-06-17T06:34:19.000Z","size":4570,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T15:01:58.551Z","etag":null,"topics":["figma","figma-console-kit"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moonvy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-13T09:58:44.000Z","updated_at":"2025-02-05T02:54:56.000Z","dependencies_parsed_at":"2022-09-24T03:12:14.092Z","dependency_job_id":null,"html_url":"https://github.com/Moonvy/FigmaConsoleKit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moonvy%2FFigmaConsoleKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moonvy%2FFigmaConsoleKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moonvy%2FFigmaConsoleKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moonvy%2FFigmaConsoleKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moonvy","download_url":"https://codeload.github.com/Moonvy/FigmaConsoleKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247203073,"owners_count":20900907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["figma","figma-console-kit"],"created_at":"2024-11-05T09:36:44.435Z","updated_at":"2025-04-04T15:32:19.168Z","avatar_url":"https://github.com/Moonvy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏂 FigmaConsoleKit\n\nBrowser 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`).\n\n\u003cimg width=\"486px\" src=\"https://user-images.githubusercontent.com/82231420/122532535-31205e80-d053-11eb-8d2c-af5bb0c8d028.gif\"/\u003e\n\n## Usege\n\n- paste code into figma console\n\n```js\nfetch(\n  \"https://raw.githubusercontent.com/Moonvy/FigmaConsoleKit/master/dist/FigmaConsoleKit.js?v1.5.0\"\n).then((r) =\u003e r.text().then((c) =\u003e eval(c)));\n```\n\nor\n\n- create a browser bookmark and add the code as address\n\n```js\njavascript:(function()%7Bfetch(%22https%3A%2F%2Fraw.githubusercontent.com%2FMoonvy%2FFigmaConsoleKit%2Fmaster%2Fdist%2FFigmaConsoleKit.js%3Fv1.5.0%22).then((r)%20%3D%3E%20r.text().then((c)%20%3D%3E%20eval(c)))%7D)()\n```\n\nor\n\n- paste [the code](dist/FigmaConsoleKit.js) into console\n\n### Access\n\n- 🔥 `activeNodes` currently selected layers (multiple)\n- 🔥 `activeNode` currently selected layer (only one is fetched)\n- `getChildrenByName(node)` get multiple sublayers by layer name\n- `getClidByName(node)` get a sublayer by layer name\n- `getNodes(node, eachFunc)` get nodes from all children by eachFunc.\n- `getNodesByName(node, name)` get nodes with the specified name from all children\n- `getNodesByType(node, type)` get nodes with the specified type from all children\n- `getNodesByTypeName(node, type, name)` get nodes with the specified type and name from all children\n\n![](./shot/shot.gif)\n\n### Print\n\n- `show(node)` Show layer information\n- `json(node)` converts the layer information into a JSON string\n\n### Color\n\n- `toFloatColor(intColor)` [255,255,255] =\u003e {r:1.0, g:1.0, b:1.0}\n- `toIntColor(floatColor)` {r:1.0, g:1.0, b:1.0} =\u003e [255,255,255]\n\n### Text\n\n- `loadNodeFonts(node)` prepare the font used for a layer\n- `setNodeText(node, text)` set the text content of the text layer\n\n### Tidy\n\n- `tidyX(nodes, cols, gap)` rearrange layers by number of columns\n\n### Export\n\n- `download([{name, input}])` download multiple Unit8Array as zip file ([client-zip](https://www.npmjs.com/package/client-zip)).\n- `downloadZip()` ([client-zip](https://www.npmjs.com/package/client-zip)).\n\n### Utils\n\n- [`axios`](https://github.com/axios/axios) best JavaScript HTTP client.\n- [`font-color-contrast`](https://github.com/russoedu/font-color-contrast#readme) use black or white font according to the given background color.\n- [`lodash`](https://github.com/lodash/lodash) a modern JavaScript utility library delivering modularity, performance \u0026 extras.\n- [`mathjs`](https://mathjs.org/) an extensive math library.\n- [`client-zip`](https://www.npmjs.com/package/client-zip) download all the files in one click.\n- [`Color`](https://github.com/Qix-/color#readme) immutable color conversion and manipulation with support for CSS color strings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonvy%2Ffigmaconsolekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoonvy%2Ffigmaconsolekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonvy%2Ffigmaconsolekit/lists"}