New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tailwindcss-patch

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-patch

patch tailwindcss for exposing context and extract classes

  • 2.0.5-alpha.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
increased by62.67%
Maintainers
1
Weekly downloads
 
Created
Source

tailwindcss-patch

get tailwindcss context at runtime ! extract all classes into file!

Nodejs version should >= 16.6.0

Setup

  1. Install package
<yarn|npm|pnpm> add -D ts-patch
  1. Patch tailwindcss
npx tw-patch install
  1. Add prepare script (keeps patch persisted after npm install)

package.json

{
  /* ... */
  "scripts": {
    "prepare": "tw-patch install"
  }
}

Usage

Cli

Init Config File

tw-patch init

Then there will be a ts file called tailwindcss-mangle.config.ts exist in your cwd.

Extract all class into a json

tw-patch extract

default there will be a json in .tw-patch/tw-class-list.json in your project.

you can custom this behavior by config tailwindcss-mangle.config.ts

Nodejs

import { TailwindcssPatcher } from 'tailwindcss-patch'

const twPatcher = new TailwindcssPatcher(/* options */)
// get all contexts at runtime
twPatcher.getContexts()
// get all class generated by tailwindcss utilities
twPatcher.getClassSet()

Migration form v1 to v2

0. cli command change

{
- "tw-patch"
+ "tw-patch install"
}

1. default remove * in json array result

[
- "*",
  "text-[99px]",
  "text-[100px]"
]

Keywords

FAQs

Package last updated on 13 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc