Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@astrouxds/astro-figma-export

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrouxds/astro-figma-export

Script to generate and download icons from a figma file

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
5
Weekly downloads
 
Created
Source

figma-export-icons

Command line script to export and download Astro's 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",
 "metaPath": "assets/svg/icons",
 "removeFromName": "Icon="
}

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
  • frame can be a path if your icons are nested, e.g. frame="Atoms/icons"

Installation

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

npm install -g @astrouxds/figma-export

Or if you prefer install it in your project

npm install @astrouxds/figma-export --save

Usage

If you're running from this repo,

npm run import

If you have installed it locally:

Create a script in your package.json

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

and run

npm run export-icons

Saving Pngs

To save as png and NOT delete the asset directory, use the -p flag:

npm run export-icons -p

Credits

This script was forked from figma-export-icons and modified.

Keywords

FAQs

Package last updated on 16 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc