GithubHelp home page GithubHelp logo

pbilyk / figma-export-icons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tsimenis/figma-export-icons

0.0 0.0 0.0 43 KB

Uses the Figma REST api to export svg icons into your project

JavaScript 100.00%

figma-export-icons's Introduction

figma-export-icons

Version Downloads

Command line script to export and download icons from a Figma file using the Figma REST api.

Description

Running the script will bring up a wizard to fill in the config for fetching the assets. You can also provide the icons-config.json yourself, then the wizard is skipped. After the config is provided, the figma file is fetched and parsed to find the icons frame, the files are downloaded and put locally in the directory provided in the config.

example config file:

{
 "figmaPersonalToken": "YOUR_PERSONAL_TOKEN",
 "fileId": "FILE_ID",
 "page": "Identity",
 "frame": "Icons",
 "iconsPath": "assets/svg/icons",
 "removeFromName": "Icon="
}

Update: from > v1.3.0 you can set the frame to -1 and it will fetch the icons from the whole page.

Features

  • Wizard to generate config, you will be prompted for any missing key
  • icons-config.json is automatically added to .gitignore if it exists
  • Directory to save the icons is created if it doesn't exist
  • Icons are deleted from local directory when fetching new
  • Icons with the same name are marked with ${iconName}-duplicate-name.svg so you can easily spot them and fix figma file
  • Running the script with -c will clear the config and run the wizard again
  • You can use a custom path to your configuration file with --config=path/to/config.json

Installation

Install the cli globally so you can use it on any directory

npm install -g figma-export-icons

Or if you prefer install it in your project

npm install figma-export-icons --save

Usage

If you have installed the module globally:

$ export-icons

If you have installed it locally:

Create a script in your package.json

scripts: {
 'export-icons': 'export-icons'
}

and run

npm run export-icons

OR

run it directly with:

npx export-icons

Credits

This script was developed and is part of our tools at Qikker Online.

figma-export-icons's People

Contributors

tsimenis avatar george-qikker avatar leonidasesteban avatar mikeozornin avatar dependabot[bot] 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.