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

add-plugin-figma

v1.0.0

Published

Zero-dependency utility helpers for Figma plugin development — color conversion, paint/effect factories, node traversal

Readme

add-plugin-figma

Zero-dependency utility helpers for Figma plugin development.

Color conversion, paint/effect factories, grid helpers, export settings, node traversal, auto-layout descriptors — all as plain functions with no Figma API required to import.

npm install add-plugin-figma

Color

import { hexToFigmaRgb, hexToFigmaRgba, figmaRgbToHex, figmaRgbToCss, mixFigmaRgb } from 'add-plugin-figma';

hexToFigmaRgb('#ff6b00')         // { r: 1, g: 0.42, b: 0 }
hexToFigmaRgba('#ff6b00', 0.5)   // { r: 1, g: 0.42, b: 0, a: 0.5 }
figmaRgbToHex({ r: 1, g: 0, b: 0 }) // '#ff0000'
figmaRgbToCss({ r: 1, g: 0, b: 0 }, 0.5) // 'rgba(255, 0, 0, 0.5)'
mixFigmaRgb(colorA, colorB, 0.5) // midpoint blend

Paints

import { solidPaint, linearGradientPaint, imagePaint } from 'add-plugin-figma';

node.fills = [solidPaint('#6366f1')];
node.fills = [solidPaint('#000000', 0.5)];

node.fills = [linearGradientPaint(
  [{ hex: '#6366f1', position: 0 }, { hex: '#8b5cf6', position: 1 }],
  135 // angle in degrees
)];

node.fills = [imagePaint(imageHash, 'FILL')];

Effects

import { dropShadow, innerShadow, layerBlur, backgroundBlur } from 'add-plugin-figma';

node.effects = [
  dropShadow({ hex: '#000000', opacity: 0.2, offsetY: 4, blur: 12 }),
  innerShadow({ offsetY: 2, blur: 4 }),
  layerBlur(8),
];

// Frosted glass
node.effects = [backgroundBlur(20)];

Grids

import { columnGrid, rowGrid, squareGrid } from 'add-plugin-figma';

frame.layoutGrids = [
  columnGrid({ count: 12, gutterSize: 16 }),
  rowGrid({ sectionSize: 8 }),
];

frame.layoutGrids = [squareGrid(4)];

Export settings

import { exportPng, exportSvg, exportPdf, exportJpeg } from 'add-plugin-figma';

node.exportSettings = [
  exportPng(1),
  exportPng(2, '@2x'),
  exportSvg(),
];

Typography

import { fontName, fontStyleFromWeight, FONT_STYLES } from 'add-plugin-figma';

textNode.fontName = fontName('Inter', 'SemiBold');
textNode.fontName = fontName('Inter', fontStyleFromWeight(600)); // 'SemiBold'

FONT_STYLES[700] // 'Bold'

Node traversal

import { walkTree, findAll, findOne, findByName, findByType, findOneByName } from 'add-plugin-figma';

// Visit every node
walkTree(figma.currentPage, node => {
  console.log(node.name, node.type);
});

// Find all TEXT nodes
const texts = findByType(figma.currentPage, 'TEXT');

// Find by name (exact)
const headers = findByName(figma.currentPage, 'Header');

// Find by name (regex)
const icons = findOneByName(figma.currentPage, /^Icon\//);

// Custom predicate
const hiddenNodes = findAll(figma.currentPage, n => !n.visible);

Sizing helpers

import { constraints, vector, rect, clamp, roundTo } from 'add-plugin-figma';

node.constraints = constraints('STRETCH', 'MIN');

// Create geometry descriptors
const pt = vector(10, 20);
const bounds = rect(0, 0, 320, 64);

clamp(value, 0, 100)
roundTo(3.14159, 2) // 3.14

Auto layout

import { autoLayout } from 'add-plugin-figma';

Object.assign(frame, autoLayout({
  direction: 'HORIZONTAL',
  spacing: 12,
  padding: 16,
  primaryAlign: 'CENTER',
  counterAlign: 'CENTER',
}));

// Vertical stack with asymmetric padding
Object.assign(frame, autoLayout({
  direction: 'VERTICAL',
  spacing: 8,
  paddingTop: 12,
  paddingBottom: 12,
  paddingLeft: 16,
  paddingRight: 16,
}));

CommonJS

const { solidPaint, dropShadow, hexToFigmaRgb } = require('add-plugin-figma');

License

MIT