Giter Club home page Giter Club logo

export-figma-svg's Introduction

Export SVGs from Figma via CLI

Getting Started

Export your SVGs that are in your Figma project easily via CLI.

Gif of exporting process

Pre-requisties

  • You will need a DEV_TOKEN (See Step 5 of Setup)
  • Your Icons are in a single Frame
  • Each icon is a Figma Component (Select Icon and use the shortcut key โŒฅโŒ˜K) Screenshot of Icon as a Figma Component

Output

Your SVGs will be generated in src/svg folder

Setup

  1. yarn install
  2. Select the frame your icons are in Screenshot of a sample Figma project
  3. Copy the URL in the browser; it should look similar to https://www.figma.com/file/abcASewbASmnas/Test?node-id=1%3123
  4. Run node src/setupEnv.js and paste in your URL copied from step 3 when prompted. This will generate a .env file
  5. Generate a DEV_TOKEN a.k.a Personal Access Token by going to Help and Account > Account Settings > Personal Access Token
  6. Add your DEV_TOKEN from step 5 into .env file
  7. Run node src/index.js and your SVGs will be generated into src/svg folder

Filtering Private Components (starting with a . or a _)

  1. If you want to ignore / filter private components that start with a . or _, change the FILTER_PRIVATE_COMPONENTS variable to true. Thanks to lennertVanSever for their contribution to this

Limitations

Figma API has a fixed number of requests (rate limits) you can call per minute. This script will process a 20 requests per 45 seconds to avoid hitting that limit.

export-figma-svg's People

Contributors

jacobtyq avatar dependabot[bot] avatar lennertvansever avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.