@3xpo/strfmt
v0.1.2
Published
String Formatting Utility
Downloads
7
Readme
@3xpo/strfmt
Implementation of sprintf in TypeScript
Installation
pnpm i @3xpo/strfmt
Usage
import { strfmt } from '@3xpo/strfmt';
const result = strfmt('Hello, %s!', 'world');
console.log(result); // Hello, world!
Spec
Based on sprintf-js' specification.
Vendoring
This package mainly exists because I didn't want to add another external package to my supply chain, hence this package was made very easy to vendor. Simply drop in the 2 files in the src
directory, and import those instead of @3xpo/strfmt
.
Of course, remember to review them before using them if you don't trust me :)