{"id":18264862,"url":"https://github.com/bem/figma-extractor","last_synced_at":"2025-04-04T21:30:56.355Z","repository":{"id":60394689,"uuid":"410885691","full_name":"bem/figma-extractor","owner":"bem","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-10T10:57:44.000Z","size":302,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-03-20T19:18:07.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/bem.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-09-27T13:00:55.000Z","updated_at":"2024-10-03T01:17:05.000Z","dependencies_parsed_at":"2023-01-23T16:16:25.626Z","dependency_job_id":null,"html_url":"https://github.com/bem/figma-extractor","commit_stats":null,"previous_names":["bem/figma-icon-extractor"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Ffigma-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Ffigma-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Ffigma-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Ffigma-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bem","download_url":"https://codeload.github.com/bem/figma-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247252040,"owners_count":20908614,"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":[],"created_at":"2024-11-05T11:16:20.439Z","updated_at":"2025-04-04T21:30:56.044Z","avatar_url":"https://github.com/bem.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @figma-extractor\n\nA set of packages for working with Figma frames\n\n```ts\nimport * as fs from 'fs'\nimport * as path from 'path'\n\nimport { Extractor } from '@figma-extractor/core'\nimport { svgoOptimize } from '@figma-extractor/svgo-optimize'\n\nconst extractor = new Extractor({\n  depth: 2,\n})\n\nconst nodes = await extractor.extract({\n    fileId: FILE_ID,\n    nodeId: NODE_ID,\n})\n\nif (!fs.existsSync(ICONS_FOLDER)) {\n    fs.mkdirSync(ICONS_FOLDER)\n}\n\nnodes\n    .map((node) =\u003e svgoOptimize(node))\n    .forEach((node) =\u003e {\n        fs.writeFileSync(path.join(ICONS_FOLDER, `${node.parent!.name}.svg`), node.content)\n    })\n```\n\n# Example\n\nTo run example, clone the repo and install deps. Then set environment variable `$FIGMA_TOKEN` and finally execute `npm run example`\n\nOr you can view source code [here](example/index.ts)\n\n# Packages\n\n## [@figma-extractor/core](packages/core/)\n\nProvides basic functionality of traversing nodes and downloading it's content\n\n## [@figma-extractor/parse-properties](packages/parse-properties/)\n\nSmall helper for parsing [Figma component properties](https://help.figma.com/hc/en-us/articles/5579474826519-Create-and-use-component-properties)\n\n## [@figma-extractor/svgo-omptimize](packages/svgo-optimize/)\n\nWrapper around `svgo`\n\n## [@figma-extractor/transform-to-jsx](packages/transform-to-jsx/)\n\nParses svg with babel and prepare for using inside JSX components\n\n# Writing your own package\n\n[`@figma-extractor/parse-properties`](packages/parse-properties/) is a good example for a fresh start. Actually there are no restrictions of how your package should be organized, but mentioned aproach highly increases reusability\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Ffigma-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbem%2Ffigma-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Ffigma-extractor/lists"}