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

@thumbsmith/cli

v0.1.8

Published

Vite-based development environment for creating thumbsmith thumbnails.

Downloads

1

Readme

@thumbsmith/cli

Command line interface for creating and managing Thumbsmith thumbnails.

Features a light weight, live reloading, vite-based development environment for best developer experience.

Installation

npm i @thumbsmith/cli -g

Usage

thumbsmith -h

Commands:
  init [name]      Create a new thumbnail template
  dev <file>       Start the development server on a thumbnail
  deploy <file>    Deploy a thumbnail template to your account
  download <name>  Download a thumbnail template file from your account

Init command

Create a new thumbnail template.

thumbsmith init [name] --starter <starter>

A new template file will be created in the directory where you ran the command.

You can then open and edit this file with your code editor of choice.

Example:

thumbsmith init
# or
thumbsmith init blog

Starter option

You can also specify a starter template to start from via the --starter option.

Example:

thumbsmith init product --starter=e-commerce

Dev command

Start the development server on a thumbnail.

thumbsmith dev <file>

A development server will be open on http://localhost:3000/

Example:

thumbsmith dev blog.thumbnail.html
# or
thumbsmith dev blog.thumbnail.html --open --port=4000

Options

  • --host [host]: [string] specify hostname
  • --port <port>: [number] specify port
  • --open: open browser on startup

Development assets

You can create a public folder that lives next to the thumbnail file to serve images for your thumbnail during development. In production, you can host them on your website or in any way you see fit.

Deploy command

Deploy a thumbnail template to your account. Requires authorization.

thumbsmith deploy <file>

The specified file will be synced to your account and made available on the Thumbsmith CDN.

This can be useful to setup automatic deployment of the thumbnail in your CI/CD workflows.

Example:

thumbsmith deploy blog.thumbnail.html
# or
thumbsmith deploy blog.thumbnail.html --api-token=MY_THUMBSMITH_TOKEN

Download command

Download a thumbnail template file from your account. Requires authorization.

thumbsmith download <name>

A template file with the contents of the specified template will be added in the directory where you ran the command.

Example:

thumbsmith download blog
# or
thumbsmith download blog --api-token=MY_THUMBSMITH_TOKEN

Authorization

Some commands require authorization (via API token) to an account to operate.

Getting an API token

Each account gets an API token on signup. Once you're logged in your account, go in the settings page and scroll to the "API Token" section.

Once there, you can see and copy the token by clicking on the eye icon on the input.

Providing the token to the CLI

There are 2 ways to provide the token to the CLI:

Via the --api-token parameter:

thumbsmith some-action --api-token=MY_THUMBSMITH_TOKEN

Via the THUMBSMITH_API_TOKEN environment variable (recommended):

We recommend this method as passing the token via the command line parameter might log it in your CI/CD's workflow or in other process monitoring tools, which might not be safe.

Depending on your environment, use the appropriate method to set the THUMBSMITH_API_TOKEN environment variable, then run the thumbsmith command.