npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

figmate

v0.0.6

Published

Get design-tokens from Figma

Readme

Figmate

Enhance your styleguide with design tokens. For Figma lovers <3

It's Alpha version for now.

Installation

The package works with node.js, so be sure that you installed latest version.

You can install in two ways:

Global (preferred way) run npm install -g figmate

Local run npm install figmate --save or npm install figmate --save-dev

How to use

  • CLI run figmate in terminal
  • CommonJS module const Figmate = require('figmate') in your .js file

How to configure

All files should be placed your project root folder:

  • in package.json
{
  "name": "yourproject",
  ...
  
  "figmate": {
    // configuration
  }
  ...
}
  • in figmate.config.json
{
  // configuration
}
  • pass as argument when call Figmate module
import Figmate from 'figmate' // Async function

Figmate({
  // configuration
})

Configuration

Token and File id (:string)

Tease options are required

Token and file id can be placed in .env file with keys:

FIGMA_TOKEN = 37-dab #example
FIGMA_FILE_ID = rD3v #example

If you don't have .env you can pass options as other options

Boards(:array of object)

You can choose any boards and any type of design tokens that you need to be parsed

boards: [
  ...
  {
    path: "Token/Fonts",
    type: "style/text"
  },
  ...
]

As a path you can specify the page or group and it's possible to be nested as you need by divider /

| Type | Description | |--------------|---------------------------------------------------------| | style/text | Text styles | | text | Raw text styles | | style/fill | Color styles | | fill | Raw color styles | | style/shadow | Box-shadow styles | | space | Spacer or indents, name and height are taken from shape | | radius | Border-radius, name and radius are taken from shape |

Platforms(:object)

Figmate is using Style dictionary package to generate files

platforms: {
  ...
}

Utils

Tease utils helps if you have themes in one file and you don't want to request the same file for every theme

getFigmaFile(:configuration object)

const { getFigmaFile } = require('figmate')

Async function to get Figma file and then parse it as you need. You can provide config as first argument.

buildTokens(:figmaFile JSON, :configuration object)

const { buildTokens } = require('figmate')

Async function to parse Figma file. You need to provide file as first argument and config as second.

Example to use utils

const { getFigmaFile, buildTokens } = require('figmate')

const themes = ['alpha', 'betta', 'gamma']

async function generateTokens(file) {
  for (const theme of themes) {
    await buildTokens(file, {
      boards: [
        {
          path: `Tokens/${theme}`,
          type: 'style/text',
        },
      ],
      platforms: {
        scss: {
          transformGroup: 'scss',
          buildPath: `${theme}/`,
          files: [
            {
              destination: `${theme}_tokens.scss`,
              format: 'scss/variables',
            },
          ],
        },
      },
    })
  }
}

getFigmaFile().then(generateTokens)