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

tailwind-killer

v1.0.2

Published

Tailwind Killer is a powerful CLI tool designed to remove Tailwind CSS from your project and migrate to regular CSS. It automates the process of converting Tailwind classes to standard CSS, making it easier to transition away from Tailwind or to refactor

Downloads

203

Readme

Tailwind Killer

Tailwind Killer is a powerful CLI tool designed to remove Tailwind CSS from your project and migrate to regular CSS. It automates the process of converting Tailwind classes to standard CSS, making it easier to transition away from Tailwind or to refactor your existing codebase.

Features

  • Converts Tailwind CSS classes to regular CSS
  • Supports multiple file types (Astro, TSX, JSX, Vue, HTML)
  • Configurable options for fine-tuned control
  • Uses a lockfile to track changes and avoid unnecessary processing
  • Optional LLM (Language Model) integration for intelligent class name generation

Installation

To install Tailwind Killer, build from source. The library will be published to NPM later, and this section will be updated.

pnpm i -g tailwind-killer

or

npm i -g tailwind-killer

Usage

To use Tailwind Killer, run the following command in your project directory:

tailwind-killer [options]

How It Works

  1. Tailwind Killer scans your project directory for files matching the specified types.
  2. It identifies Tailwind classes in these files.
  3. For each unique set of Tailwind classes, it generates a new CSS class name.
  4. It replaces the Tailwind classes in your files with the newly generated class names.
  5. It creates CSS files with the converted styles.
  6. A lockfile is used to track changes and optimize subsequent runs.

LLM Integration

When useLLM is set to true, Tailwind Killer uses a Language Model to generate meaningful class names based on the Tailwind classes. This can result in more readable and maintainable CSS. The openaiApiUrl option specifies the endpoint for the LLM service.

Lockfile

The lockfile (default: tailwind-killer-lockfile.json) keeps track of processed files and their hash values. This ensures that only modified files are processed in subsequent runs, improving performance.

Configuration Options Explained

  • rootDir: The starting point for file scanning. Set this to target a specific directory in your project.
  • lockfilePath: Location of the lockfile. Customize this if you want to store the lockfile in a different location.
  • orderMatters: Set to true if the order of Tailwind classes is significant in your project.
  • scannedFileTypes: Add or remove file extensions to control which files are processed.
  • maxLLMInvocations: Limits the number of times the LLM is called, useful for controlling API usage.
  • prefix: Customize the prefix for generated class names to avoid conflicts with existing classes.
  • openaiApiUrl: Set this to your OpenAI API endpoint or a compatible service.
  • excludedDirectories: Add directories you want to skip during processing.
  • useLLM: Disable this if you prefer not to use LLM for class name generation.

Best Practices

  • Always backup your project before running Tailwind Killer.
  • Start with a small subset of files to test the output before processing your entire project.
  • Review the generated CSS and class names to ensure they meet your project's naming conventions.
  • Use version control to easily track and manage changes made by Tailwind Killer.
  • Adjust the maxLLMInvocations based on your API usage limits and project size.
  • Customize the prefix to align with your project's naming conventions.
  • Regularly update your excludedDirectories list as your project structure evolves.

Contributing

Contributions to Tailwind Killer are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to this project.

License

Tailwind Killer is released under the MIT License. See the LICENSE file for more details.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.