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

@rschristian/twind-cli

v0.3.0

Published

Twind CLI

Downloads

5

Readme

@twind/cli

MIT License Latest Release Github Typescript

Twind Demo

Changes

As a Twind user, I found myself wanting to continue using the tool even on smaller projects, such as building singular HTML files. The difficulty that arises there is that build scripts will inevitably need to be created to get a decent development experience, like file watching, automatic rebuilding, etc. While @twind/cli came close to what I had desired, it still had a number of shortcomings, like missing warnings when unrecognized class names were used, no support for inlining the built CSS, and no support for the grouping syntax. Hence, a fork was necessary and this also allows me to add some more personalizations that conflict with a general use tool.

This fork has lost much of its flexibility and therefore is not likely to appeal to any sort of general audience. It's been altered to fit my exact use case and unwanted functionality has been cut out entirely. I've provided a change log of sorts below that, while not comprehensive, covers most of the major changes.

Many thanks to Sascha for building the base for this tool.

  1. No longer supports glob inputs
  • I simply have no need of this. Singular file input only.
  1. Any styles not found in a class="..." will be ignored
  • The regex will ignore any class name not declared this way. If you have some JS creating UI elements, those styles will be included as long as they can use that style of class name assigning. Sorry React, but you're not supported.
  1. Input and output is HTML
  • No longer supports a wide variety of inputs, and no longer outputs a standalone CSS file. Input must be HTML and is expected to contain <style id="__twind"></style>. This is where the resulting CSS will be injected.
  1. Full minification of input HTML
  • Something I use and so it made sense to insert here. The HTML doc will be minified with terser. No option to disable this.
  1. No support for Tailwind config files
  • Use twind.config.{[m]js,ts} instead.

Installation

Install from npm:

# Using npm
npm install @rschristian/twind-cli

# Using Yarn
yarn add @rschristian/twind-cli

Usage

## Basic usage, outputs to 'ouput.html'
twind index.html

# Use custom output
twind index.html -o foo.html

# Disable watch mode
twind index.html --no-watch

# Use different twind config
twind index.html -c src/twind.config.ts
  Usage
    $ twind <input> [options]

  Options
    -o, --output     Set output html file path  (default output.html)
    -c, --config     Set config file path  (default {.,src,pages,docs}/twind.config.{[m]js,ts})
    -w, --watch      Watch for changes  (default true)
    -v, --version    Displays current version
    -h, --help       Displays this message

License

MIT