You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

figma-export-svg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

figma-export-svg

This is a simple CLI tool to export SVGs from Figma. It uses the Figma API to fetch the SVGs and saves them to the local file system, then optionally optimizes them using SVGO.

0.0.7
latest
npmnpm
Version published
Weekly downloads
52
5100%
Maintainers
1
Weekly downloads
 
Created
Source

Figma Export SVG

This is a simple CLI tool to export SVGs from Figma. It uses the Figma API to fetch the SVGs and saves them to the local file system, then optionally optimizes them using SVGO.

Installation

npm install -g figma-export-svg

Usage

figma-export-svg -a <access-token> -f <file-id> -n <node-ids (comma-separated)> -o <output-dir>

Options

  -a, --access-token <access-token>  Figma personal access token (https://www.figma.com/developers/api#access-tokens)
  -c, --clear-output-dir             Clear output directory before saving new SVGs
  -o, --output-dir <output-dir>      Output directory
  -f, --file-id <file-id>            Figma file ID, e.g., oQ5VCtq1r0KrPx3VpqMSX5
  -n, --node-ids <node-ids>          Figma node IDs (comma-separated), e.g., 5432:1234,1234:9876
  --file-name-strategy <strategy>    File name strategy: camel, pascal, pascalSnake, constant, kebab, snake, train. Default: kebab
  --svgo-config <value>              Path to SVGO config file (e.g., ./svgo.config.mjs)
  -h, --help                         display help for command
  
  # Figma API options (see: https://www.figma.com/developers/api#get-images-endpoint)
  --scale <value>                    Scale factor for the exported SVGs. Between 0.01 and 4.
  --outline-text                     Convert text to outlines if configured
  --include-id                       Whether to include id attributes for all SVG elements
  --include-node-id                  Whether to include node id attributes for all SVG elements
  --simplify-strokes                 Simplify strokes in the exported SVGs
  --contents-only                    Whether content that overlaps the node should be excluded from rendering
  --absolute-bounds                  Whether to use absolute bounding box for exported SVGs

FAQs

Package last updated on 02 Apr 2025

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