A JavaScript library (v1.0.0) for styling strings using a builder pattern inspired by Android's SpannableString. It allows chaining .text(), .property() methods to apply CSS-like styles (text-color, text-decoration) and outputs a HTML string. Ships TypeScript types. Last updated in 2020, likely stable but not actively maintained. Differentiated by its simple API mimicking Android's SpannableString, but limited in features compared to libraries like chalk or ansicolor.
npm install spannable-string-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates the builder pattern: create formatted text by chaining .text() and .property() methods, then output as HTML string.
Consider actively maintained alternatives like 'chalk' or 'ansicolor'.
Use separate .property() calls for each CSS property-value pair.
Sanitize user input before passing to .text() or escape HTML entities manually.
Check supported properties in documentation; consider extending the parser if needed.
Use `import { SpannableStringFormatter } from 'spannable-string-formatter'`Ensure start with .text() before .property() methods.
No dependency data recorded yet.