@protohiro/csstokens-core
v0.2.0
Published
Core extraction and token grouping engine for csstokens
Maintainers
Readme
@protohiro/csstokens-core
@protohiro/csstokens-core provides the extraction, normalization, grouping, and emitter logic behind the csstokens design token extractor.
Use it when you need library access to design token extraction from existing frontend codebases.
Install
npm install @protohiro/csstokens-coreUsage
import { buildRefactorPlan, extractFiles } from '@protohiro/csstokens-core';The package is intended for library use. For filesystem scanning and end-user commands, use csstokens.
You can also build a dry-run replacement plan from extracted tokens and the raw index:
const result = extractFiles(files, { prefix: 'pt' });
const plan = buildRefactorPlan(result.rawIndex, result.tokens, 'pt');