JSPM

  • Created
  • Published
  • Downloads 12890
  • Score
    100M100P100Q140226F
  • License MIT

Command line for @figma-export

Package Exports

  • @figma-export/cli

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@figma-export/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@figma-export/cli

Command line for @figma-export.

Install

Using npm:

npm i -D @figma-export/cli

or using yarn:

yarn add @figma-export/cli --dev

Usage

export FIGMA_TOKEN=<personalAccessToken>

figma-export [COMMAND]

Commands

components

figma-export components [FILEID]

transformers

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

You can create you own:

module.exports = options => {
    return (svg) => new Promise((resolve, reject) => {
        resolve(svg);
    });
}
module.exports = options => {
    return async (svg) => {
        return svg;
    };
}
npm install -g @figma-export/transform-svg-with-svgo

figma-export components RSzpKJcnb6uBRQ3rOfLIyUs5 -T @figma-export/transform-svg-with-svgo

outputters

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

You can create you own:

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

Usage:

npm install -g @figma-export/output-components-as-svg

figma-export components RSzpKJcnb6uBRQ3rOfLIyUs5 -O @figma-export/output-components-as-svg