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

@tempad-dev/plugins

v0.6.1

Published

Plugin utils for TemPad Dev.

Readme

@tempad-dev/plugins

Developer tooling for creating custom code generators that run inside TemPad Dev. This package provides type-safe helpers, transform hooks, and traversal utilities so you can adapt the inspector output to your own design system or workflow.

Installation

# npm
npm install -D @tempad-dev/plugins

Quick start

Create a new JavaScript or TypeScript file that exports a plugin with definePlugin:

import { definePlugin } from '@tempad-dev/plugins'

export default definePlugin({
  name: 'My Plugin',
  code: {
    css: {
      title: 'SCSS',
      lang: 'scss',
      transform({ code }) {
        return code.replace(/px/g, 'rem')
      }
    },
    js: false // hide the built-in JavaScript block
  }
})

Once the file is hosted somewhere accessible (e.g. GitHub raw URL), paste the URL into TemPad Dev's Preferences → Plugins panel to load it.

Plugin anatomy

Each plugin exports an object with a name and a code map. The code map determines the blocks TemPad Dev will render. You may override the built-in css and js blocks or introduce your own:

definePlugin({
  name: 'Tailwind Adapter',
  code: {
    css: false,
    tailwind: {
      title: 'Tailwind',
      lang: 'js',
      transform({ style }) {
        return toTailwind(style)
      }
    }
  }
})

Each entry in code accepts the following options:

  • title: Overrides the block heading.
  • lang: Sets syntax highlighting (css, scss, js, json, etc.).
  • transform: Receives the generated CSS string plus a parsed style object.
  • transformVariable: Allows remapping of CSS variables before output.
  • transformPx: Converts numeric pixel values (respecting user settings like useRem).
  • transformComponent: Converts Figma instances into higher-level dev components.

Set the block to false to remove it from the UI altogether.

Transform hooks in detail

transform({ code, style, options })
  • code: Canonical CSS string TemPad Dev generated.
  • style: Plain object keyed by CSS property.
  • options.useRem: User preference indicating whether px should be converted to rem.
  • options.rootFontSize: Reference font size for rem calculations.
transformVariable({ code, name, value, options })
  • code: Full var(--token, fallback) snippet.
  • name: Variable token name.
  • value: Raw fallback value if provided.
transformPx({ value, options })
  • value: Numeric pixel value that TemPad Dev is about to print.
transformComponent({ component })
  • component: DesignComponent representing the Figma instance currently inspected. Return either a serializable DevComponent tree (via h) or a string.

Building component trees

Use the JSX-like h helper to compose nested structures:

import { definePlugin, h } from '@tempad-dev/plugins'

export default definePlugin({
  name: 'React Output',
  code: {
    component: {
      title: 'Component',
      lang: 'tsx',
      transformComponent({ component }) {
        return h('Card', { variant: component.properties.variant }, [
          h('Heading', { level: 2 }, [component.properties.title]),
          h('Button', { intent: 'primary' }, ['Submit'])
        ])
      }
    }
  }
})

TemPad Dev will serialize the returned DevComponent into JSX/TSX for display.

Navigating design nodes

Plugins often need to search through the inspected node tree. The following helpers are exported:

findChild(container, query)
findChildren(container, query)
findOne(container, query)
findAll(container, query)
queryOne(container, queries)
queryAll(container, queries)

Queries can be simple property filters ({ type: 'TEXT', name: /Title/ }) or custom predicates. queryAll/queryOne let you chain multiple lookups, e.g. find a footer frame and then every button inside it. See plugins/src/index.ts for full documentation and the type definitions for DesignNode, DesignComponent, and related structures.

Debugging and testing

  • Use TemPad Dev's preview panel to inspect the final code blocks rendered by your plugin.
  • During development you can run your plugin locally by serving it from a dev server (Vite, Next, etc.) and referencing the local network URL from TemPad Dev.
  • Consider writing unit tests around your transform functions by importing them directly and feeding mocked node data.

Publishing

  1. Build your plugin bundle (if using TypeScript or modern syntax).
  2. Host the generated file somewhere that supports cross-origin requests (GitHub raw, CDN, etc.).
  3. Optional: contribute to plugins/available-plugins.json so users can load your plugin by name.

Further resources

  • Root project README: insights into TemPad Dev features and plugin registry expectations.
  • plugins/src/index.ts: canonical source of all exported types, with extensive inline documentation and examples.
  • Example plugins: https://github.com/Justineo/tempad-dev-plugin-kong

Feel free to open issues or pull requests in this repository if you encounter limitations or have ideas for new helper APIs that would make plugin development easier.