Small text helpers: fill placeholders in a template, pad values to a width, trim, repeat.
npm install @tsdotnet/text-utilityimport { supplant, padLeft } from '@tsdotnet/text-utility';
const name = 'Ada';
supplant('Hello, {name}', { name }); // "Hello, Ada"
padLeft(7, 3); // "007"Also format, repeat, trim and more; everything is exported by name, or together as textUtility.
ESM (import { supplant, padLeft } from '@tsdotnet/text-utility';) or CommonJS (const { supplant, padLeft } = require('@tsdotnet/text-utility');).
In a browser, without a bundler
<script src="https://cdn.jsdelivr.net/npm/@tsdotnet/text-utility@1/dist/umd/text-utility.min.js"></script>
<script>
const { supplant, padLeft } = tsdotnet.textUtility;
</script>