@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