{"id":26456,"library":"tailwind-transpiler","title":"Tailwind Transpiler","description":"A tool (v0.0.27) that parses source files to extract custom Tailwind CSS class names used in HTML/JSX templates and consolidates them into a single JSON file. It relies on AST-based parsing to identify dynamic or custom class combinations that Tailwind's default purge might miss. The project is in early development with no release cadence; its key differentiator is focused extraction of custom classes for Tailwind's safelist, intended for build pipeline integration via npm scripts. Currently limited to default 'src' folder and outputs 'extracted-classes.json'.","status":"active","version":"0.0.27","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","tailwind","transpiler","extract-classes","custom-classes","typescript"],"install":[{"cmd":"npm install tailwind-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add tailwind-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add tailwind-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package provides a CLI binary with name 'extract-classes', not a programmatic API. Use npx or add as npm script.","wrong":"extract-classes","symbol":"extract-classes CLI","correct":"npx extract-classes"},{"note":"Script expects the command name 'extract-classes', not the package name.","wrong":"{\"scripts\": {\"extract\": \"tailwind-transpiler\"}}","symbol":"automated usage","correct":"{\"scripts\": {\"extract\": \"extract-classes\"}}"},{"note":"Pass target folder as positional argument, not a flag.","wrong":"extract-classes --folder=./custom-folder","symbol":"custom folder argument","correct":"extract-classes ./custom-folder"}],"quickstart":{"code":"npm install tailwind-transpiler --save-dev\n\n// package.json\n\"scripts\": {\n  \"extract\": \"extract-classes\"\n}\n\nnpm run extract\n\n// Or with custom folder:\nnpm run extract -- src/components","lang":"javascript","description":"Install as dev dependency and run the CLI to extract custom Tailwind classes from source code into extracted-classes.json."},"warnings":[{"fix":"Use npx tailwind-transpiler or specify full path in npm scripts.","message":"CLI name 'extract-classes' may conflict with other packages that expose a binary with same name.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use child_process.exec to invoke CLI programmatically.","message":"No type definitions are exported for programmatic use; only CLI is supported.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Back up existing file before running extraction.","message":"Output overwrites 'extracted-classes.json' without prompt, potentially losing previous manual safelist entries.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use npx extract-classes or add to npm scripts as shown.","cause":"Binary not in PATH because npx not used or package not installed globally.","error":"bash: extract-classes: command not found"},{"fix":"Run extract-classes <path-to-existing-folder>","cause":"The default 'src' folder does not exist; must specify a valid folder.","error":"ENOENT: no such file or directory, scan './src'"},{"fix":"Ensure npm install tailwind-transpiler --save-dev ran and use CLI only, not require().","cause":"Package not installed or used in programmatic context incorrectly.","error":"Cannot find module 'tailwind-transpiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}