README
strings">
This project is part of the @thi.ng/umbrella monorepo.
About
Various higher-order, configurable string formatting & utility functions, some memoized. Please sources / docstrings for now.
Partially based on Clojure version of thi.ng/strf.
Status
STABLE - used in production
Search or submit any issues for this package
Installation
yarn add @thi.ng/strings
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/strings?module" crossorigin></script>
// UMD
<script src="https://unpkg.com/@thi.ng/strings/lib/index.umd.js" crossorigin></script>
Package sizes (gzipped, pre-treeshake): ESM: 3.65 KB / CJS: 3.94 KB / UMD: 3.74 KB
Dependencies
Usage examples
Several demos in this repo's /examples directory are using this package.
A selection:
Screenshot | Description | Live demo | Source |
---|---|---|---|
![]() |
Basic crypto-currency candle chart with multiple moving averages plots | Demo | Source |
Basic SPA example with atom-based UI router | Demo | Source | |
![]() |
rstream based spreadsheet w/ S-expression formula DSL | Demo | Source |
![]() |
XML/HTML/SVG to hiccup/JS conversion | Demo | Source |
API
Basic usage examples
// create a custom string formatter
const fmt = defFormat([
"Price: ",
{ usd: "