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 🙏

© 2024 – Pkg Stats / Ryan Hefner

glypfig

v1.0.10

Published

Icon library workflow for Figma

Downloads

27

Readme

Glypfig

NPM Patreon Apache 2.0 license E2E tests and deploy

The icon library workflow for Figma.

Glypfig icon library creator

Picks up your existing icons from Figma and outputs them ready for production. Currently supported export formats include JPG, PDF, PNG, SVG, CSS and React (with typescript support). Can also optimize image assets and builds UI components according to your custom template.

Find an example Storybook with all formats here🚀

Prerequisites

  • NodeJS installed
  • Figma project with a page that has a frame or similar container with icon components
  • Figma API key – Generate new personal access token at Settings -> Account -> Personal access tokens
  • File key – Your file's (with the icon components) key identifier e.g. figma.com/file/{figma-file-key}/Glypfig
  • Node ID – Your frame's URL decoded node ID e.g. figma.com/...?node-id=0%3A1 -> URL decoded to 0:1

Figma notes

To exclude a component to be exported from the frame prefix it's name with a dot e.g. ".Title". Frames and groups along with their child nodes can also be excluded in the same way.

For best results always have your icon component's main layer in Figma boxed with equal width and height e.g. 24x24px.

Development notes

It is suggested to run a linter on build components such as Prettier, Stylelint and code analyser such as ESLint.

Get started

  1. Install Glypfig from NPM with npm or yarn.

    npm install --save-dev glypfig
    yarn add --dev glypfig
  2. Run with your preferred configuration. See all the possible options below.

    npx glypfig --apikey <figma-api-key> --filekey <figma-file-key> --nodeid <icon-frame-node-id>

Configuration

| Parameter | Flag | Value | Default | Options | | ----------------- | -------------- | ------- | ------------------------- | ------------------------------------------------------------ | | Figma API Key | apikey, a | string | None | Figma: Settings/Account/Personal access tokens | | File key | filekey, k | string | None | e.g. figma.com/file/{figma-file-key}/Glypfig | | Node ID | nodeid, n | string | None | figma.com/...?node-id=0%3A1 URL param value decoded to 0:1 | | Output format | format, f | string | png,svg,react | jpg, png, svg, pdf, css and react | | Output path | output, o | string | icon-library | e.g. ./the-path/to/your-icons | | Silent logging | silent, s | boolean | false | true or false | | Optimize files | optimize, p | boolean | false | true or false | | Template formats | template, t | string | jsx | jsx and tsx | | CSS template path | csspath, c | string | ./templates/css.eta | e.g. ./the-path/to/your-template-css.eta | | JS template path | jspath, j | string | ./templates/react-jsx.eta | e.g. ./the-path/to/your-template-tsx.eta | | CSS prefix | cssprefix, r | string | icon- | e.g. 'glypfig-' | | JS prefix | jsprefix, e | string | Icon | e.g. 'Glypfig' | | License file | license, l | string | ./templates/LICENSE.txt | Pass '' for default or e.g. ./the-path/to/your-license-file | | JPG image scale | jpgscale, b | string | None | Scale of exported image 0.01 - 4 | | PNG image scale | pngscale, d | string | None | Scale of exported image 0.01 - 4 | | Properties filter | filter, i | string | None | Filter components by properties e.g. 'Size=XS, Color=Blue' | | Property naming | propnames, m | boolean | None | Figma component properties in name e.g. icon-size-large.svg | | Help | help, h | boolean | None | Show help |

More

Support this project

Eta templating engine

Thanks

Helsinki Design System