WASM-powered Tailwind CSS's Oxide parser for browser and Node.js.
Note
This package is automatically generated from the https://github.com/wind-press/oxide-parser repository.
npm install @windpress/oxide-parserimport { getCandidates } from '@windpress/oxide-parser';
// Single string
const candidates = await getCandidates('<div class="flex p-4">');
// ['flex', 'p-4']
// Multiple strings
const batch = await getCandidates([
'<div class="flex p-4">',
'<span class="text-white">',
]);
// ['flex', 'p-4', 'text-white']import { getCandidates } from 'https://esm.sh/@windpress/oxide-parser';
const candidates = await getCandidates('<div class="flex p-4">');import { init, getCandidatesSync } from '@windpress/oxide-parser';
await init();
const candidates = getCandidatesSync('<div class="flex">');await init('https://cdn.example.com/oxide_parser.wasm');Extracts Tailwind candidates (auto-initializes WASM).
- input:
string | string[] - returns:
Promise<string[]>
Synchronous version (requires init() first).
- input:
string | string[] - returns:
string[]
Initializes WASM module.
- wasmUrl:
string(optional) - returns:
Promise<void>
Checks if WASM is ready.
- returns:
boolean
- Rust + wasm-pack:
cargo install wasm-pack - Node.js 18+
- pnpm:
npm install -g pnpm
pnpm install
pnpm run build
pnpm run dev