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

widget-builder

v1.0.3

Published

CLI and program to compile HTML into custom desktop widgets

Downloads

9

Readme

Table of Contents

  1. Installation
  2. Quickstart Guide
  3. Samples
  4. Publishing and installing
    1. Publishing
    2. Installing
  5. The Config File
  6. Using the CLI
  7. Contributing Widgets

Installation

Download, unzip, navigate to the folder, and install with npm:

$ npm install -g
$ npm start

or download directly from npm:

$ npm install -g widget-builder

Quickstart Guide

  1. Create a new folder
  2. cd to the folder, enter widgets init, and fill in your project's name
  3. Mess around with the generated HTML file to customize your widget's appearance
  4. Add and link JavaScript or CSS files to your master HTML file
  5. Modify the config file
  6. Navigate to the folder and enter widgets build to locally build and install your widget

Samples

Check out Spotify listener, a widget for listening to your favorite tunes: Spotify listener

Publishing and installing widgets

Publishing

So you want to share your widget for distribution? Here's what to do:

  1. cd to your project folder
  2. Run widgets publish
  3. A new dist folder will be generated in the same directory as your project folder. You can now distribute this folder, and others can install it with widgets install

Installing

Here's how to install a widget that was shared with you:

  1. Navigate to the folder
  2. Run widgets install

The Config File

Every widgets project contains a config.json file. This file tells the program what settings you would like to use for your widget. Here's a standard config file:

{
  "name": "widget",
  "version": "1.0.0",
  "description": "Custom desktop widget",
  "index": "./index.html",
  "properties": {
    "x": 100,
    "y": 100,
    "width": 100,
    "height": 100,
    "transparent": false,
    "interact": true,
    "draggable": true
  }
}

| Property | Definition | | ---- | ---- | | name (string) | Project name | | version (string) | Project version | | index (string) | The reference to your master HTML file. Other references (like JS or CSS) should be linked in this file. | | x, y, width, and height (integers) | The position and dimensions of your widget when it is first start up | | transparent (boolean) | Make the widget's background transparent | | interact (boolean) | Make the widget interactable | | draggable (boolean) | Make the widget draggable | | top (boolean) | Make the widget stay on top of all windows | | requirements (array) | npm packages required for the widget to function; these packages are locally installed when the widget is installed | | install (string or array) | Script(s) to run during widget installation |

Using the CLI

Once widget builder is installed, the CLI can be accessed with the keyword widgets

Commands

| Command | Definition | | ---- | ---- | | widgets build [folder] | Builds HTML files to desktop widget and installs | | widgets publish [folder] | Generates a dist file that can be installed by the widgets cli | | widgets install [folder] | Installs widget at folder | | widgets init [folder] | Initializes widgets project | | widgets list | Lists all installed widgets | | widgets uninstall <widget> | Uninstall widget by name | | widgets config <widget> | Configure widget by name | | widgets start [folder] | Starts the widget at folder |

Options

| Command | Definition | | ---- | ---- | | widgets --help | Show help | | widgets --version | Displays the current version |

Contributing Widgets

Here you can find instructions for sharing widgets you have created