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

sketch-plugin-helper

v0.1.0

Published

A batteries-included toolkit for making Sketch plugins

Downloads

37

Readme

Sketch Plugin Helper npm Version

A batteries-included toolkit for making Sketch plugins

Sketch Plugin Helper

Motivation · Plugin Basics · Getting User Input · Plugin Utilities · Testing Your Plugin

Features

See Motivation.

Quick start

Requires Node.js.

To begin:

$ npm install --global sketch-plugin-helper
$ sketch create sketch-hello-world

Enter the information prompted for. Then:

$ cd sketch-hello-world
$ npm install

Next, create a src/hello-world.js file containing the following:

import { showMessage } from 'sketch-plugin-helper'

export default function () {
  showMessage('Hello, World!')
}

Our plugin handler must be the default export of the file. (See Plugin Utilities for a list of helpful functions that you can use in your plugin.)

Then, in our package.json, set src/hello-world.js as the handler for our plugin menu command:

{
  ...
  "sketch-plugin-helper": {
    ...
-   "menu": []
+   "menu": [
+     {
+       "handler": "hello-world",
+       "name": "Hello, World!"
+     }
+   ]
  }
}

Note that the initial src/ and trailing .js extension is omitted.

Then, build our plugin, and install the plugin as a symbolic link:

$ npm run build && npm run symlink

Finally, open a new document in Sketch. Then, run our hello-world command:

$ npm run handler -- hello-world

You should see a Hello, World! message appear near the bottom of the Sketch interface.

To rebuild our plugin whenever we make a change, do:

$ npm run watch

Docs

Reference plugin implementations

Plugin name | Description :-|:- Add Artboard Borders and Titles | Automatically add borders and titles to artboards Align to Grid | Align artboards and layers to a grid Clean Document | Automagically organise and clean up your Sketch document Draw Slice Over Selection | Draw a slice over the selection Export Prototype | Export a clickable prototype from your Sketch file Extract Text | Extract text from layers that match a regular expression Find and Replace Text | Find and replace text in text layers and symbol instances Move Layers | Precisely move and arrange layers Select Layers | Create or filter a selection of layers based on name, type or similarity Sort Layer List | Sort the layer list by name or layer position

Installation

$ npm install --global sketch-plugin-helper

License

MIT