@figma-export/cli
Command line for @figma-export
Last updated 2 months ago by marcomontalbano .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @figma-export/cli 
SYNC missed versions from official npm registry.

@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 help components

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
module.exports = options => {
    return (svg) => new Promise((resolve, reject) => {
        resolve(svg);
    });
}
// with async/await
module.exports = options => {
    return async (svg) => {
        return svg;
    };
}

or install an official transformer:

Package Version
@figma-export/transform-svg-with-svgo npm

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:

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

or install an official outputter:

Package Version
@figma-export/output-components-as-es6 npm
@figma-export/output-components-as-stdout npm
@figma-export/output-components-as-svg npm
@figma-export/output-components-as-svgr npm
@figma-export/output-components-as-svgstore npm

Current Tags

  • 2.0.0                                ...           latest (2 months ago)
  • 2.0.0-alpha.3                                ...           next (2 months ago)

20 Versions

  • 2.0.0                                ...           2 months ago
  • 2.0.0-alpha.3                                ...           2 months ago
  • 2.0.0-alpha.2                                ...           3 months ago
  • 2.0.0-alpha.1                                ...           3 months ago
  • 1.2.0                                ...           4 months ago
  • 1.1.1                                ...           4 months ago
  • 1.1.0                                ...           6 months ago
  • 1.0.0                                ...           7 months ago
  • 0.0.1-alpha.12                                ...           7 months ago
  • 0.0.1-alpha.11                                ...           7 months ago
  • 0.0.1-alpha.10                                ...           7 months ago
  • 0.0.1-alpha.9                                ...           7 months ago
  • 0.0.1-alpha.8                                ...           7 months ago
  • 0.0.1-alpha.6                                ...           7 months ago
  • 0.0.1-alpha.5                                ...           8 months ago
  • 0.0.1-alpha.4                                ...           8 months ago
  • 0.0.1-alpha.3                                ...           8 months ago
  • 0.0.1-alpha.2                                ...           8 months ago
  • 0.0.1-alpha.1                                ...           a year ago
  • 0.0.1-alpha.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 20
Dependencies (6)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |