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

@figma-export/cli

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@figma-export/cli

Command line for @figma-export

  • 6.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.4K
decreased by-5.85%
Maintainers
1
Weekly downloads
 
Created
Source

@figma-export/cli

Command line for @figma-export.

Install

While you can install it globally on your machine, it's much better to install it locally project by project.

npm install --save-dev @figma-export/cli

Note: If you do not have a package.json, create one before installing or run npm init -y to automatically create ones.

Usage

export FIGMA_TOKEN=<personalAccessToken>

npx figma-export COMMAND

Note: These instructions use the npx command to run the locally installed executables. You can drop it inside of an npm run script or you may instead execute with the relative path instead. ./node_modules/.bin/figma-export

Commands

help

npx figma-export --help

use-config

This command is well-explained into the project README. Look at advanced section.

components

Exports components from a Figma file

npx figma-export components FILEID

# help
npx figma-export components --help
transformers

--transformer -T option

npx figma-export components FILEID -T TRANSFORMER

A transform function receives an SVG and turns it into something new.

You can create you own:

// with promise
export default options => {
    return (svg) => new Promise((resolve, reject) => {
        resolve(svg);
    });
}
// with async/await
export default options => {
    return async (svg) => {
        return svg;
    };
}

or install an official transformer:

PackageVersion
@figma-export/transform-svg-with-svgonpm
outputters

--outputter -O option

npx figma-export components FILEID -O OUTPUTTER

An output function receives a list of pages, in which each page contains components.

You can create you own:

export default options => {
    return async pages => {
        console.clear();
        console.log(JSON.stringify(pages));
    };
}

or install an official outputter:

PackageVersion
@figma-export/output-components-as-es6npm
@figma-export/output-components-as-stdoutnpm
@figma-export/output-components-as-svgnpm
@figma-export/output-components-as-svgrnpm
@figma-export/output-components-as-svgstorenpm

styles

Exports styles from a Figma file

npx figma-export styles FILEID

# help
npx figma-export styles --help
outputters

--outputter -O option

npx figma-export styles FILEID -O OUTPUTTER

An output function receives a list of styles.

You can create you own:

export default options => {
    return async styles => {
        console.clear();
        console.log(JSON.stringify(styles));
    };
}

or install an official outputter:

PackageVersion
@figma-export/output-styles-as-cssnpm
@figma-export/output-styles-as-style-dictionarynpm
@figma-export/output-styles-as-sassnpm
@figma-export/output-styles-as-lessnpm

Keywords

FAQs

Package last updated on 02 Sep 2024

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