JavaScript number formatter that converts integers to CSS list-style-type representations (e.g., decimal, lower-roman, upper-alpha, armenian, cjk-ideographic). Version 1.0.0, last updated in 2017. Supports all standard CSS list-style-type values plus many national/regional variants. Unlike CSS-only solutions, it works in JavaScript environments (Node.js or browser) for use in dynamic content generation, PDFs, or non-HTML contexts. The library provides a single function `format()` taking a number and a style string, returning the formatted string. It has no dependencies and is lightweight. However, it is no longer actively maintained (no updates since 2017).
npm install liststyletype-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates formatting numbers using various CSS list-style-type styles with the library's single `format` method.
Wrap calls in try/catch or validate the style string against the supported list before calling format().
Check the return value for the '✘' character to detect unsupported numbers. For such cases, fall back to decimal or another style.
Manually create a .d.ts file or use // @ts-ignore. Consider migrating to @likelist/liststyletype-formatter which may have TS support.
Fork the repository and update, or use a more modern alternative like 'css-list-style-type' or implement a custom formatter.
Use `ListStyleTypeFormatter.format(number, style)` instead of `ListStyleTypeFormatter(number, style)`.
Run `npm install liststyletype-formatter` and ensure the require path is correct (e.g., `require('liststyletype-formatter')`).Check the list of supported styles (e.g., 'decimal', 'lower-roman', 'upper-alpha', etc.) and use a valid one.
No dependency data recorded yet.