0.0.1-beta.2 • Published 3 years ago
smtfmt v0.0.1-beta.2
smtfmt
Utilities for formatting and printing Strings.
smtfmt is ported from SmartFormat.NET.
Installing
Install smtfmt using npm:
npm install --save smtfmtOr yarn:
yarn add smtfmtExamples
JavaScript:
const { fromat } = require('smtfmt');
format('Hello'); // -> Hello
format('Hello, {0}!', 'World'); // -> Hello, World!
format('The number is {0}', 1); // -> The number is 1
format('{0} {1}', 1, 2); // -> 1 2TypeScript:
import { fromat } from 'smtfmt';
format('Hello'); // -> Hello
format('Hello, {0}!', 'World'); // -> Hello, World!
format('The number is {0}', 1); // -> The number is 1
format('{0} {1}', 1, 2); // -> 1 2