1.0.2 • Published 8 months ago

figma-token-converter v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

figma-token-converter

Convert Figma design tokens to JSON and SCSS formats.

Installation

npm install figma-token-converter

Usage

Setup

Create a .env.local file with your Figma API token and file key:

FIGMA_TOKEN=your_figma_token_here
FIGMA_FILE_KEY=your_figma_file_key_here
const figmaConverter = require('figma-token-converter');

figmaConverter.fetchTokens({ figmaFileId, accessToken })
  .then(tokens => figmaConverter.toJSON(tokens))
  .then(json => console.log(json))
  .catch(console.error);

6. Build Scripts

For packaging, add a build script to package.json:

"scripts": {
  "build": "babel src -d lib",
  "test": "jest",
  "prepublish": "npm run build"
}
1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago